Welcome Guest, Not a member yet? Register   Sign In
update query
#3

[eluser]Georgi Veznev[/eluser]
[quote author="André Padez" date="1289775347"]Hi,

I wish to make something like:

Code:
$query = 'update table set field = value where id = 3';
$result = $this->db->($query);
$count = $result->num_rows(); //should return the number of rows affected by the last query
return $count;
Instead, the only workaround i found is:

Quote:$query = 'select * from table where id = 3';
$result = $this->db->($query);
$count = $result->num_rows();
if($count > 0){
$query = 'update table set field = value where id = 3';
$result = $this->db->($query);
}
return $count;

does anyone know how i can use the first form?
Thanx[/quote]


http://ellislab.com/codeigniter/user-gui...lpers.html

Code:
$query = 'update table set field = value where id = 3';
$result = $this->db->($query);
$count = $result->affected_rows(); //should return the number of rows affected by the last query
return $count;


Messages In This Thread
update query - by El Forum - 11-14-2010, 10:55 AM
update query - by El Forum - 11-14-2010, 11:51 AM
update query - by El Forum - 11-14-2010, 11:55 AM
update query - by El Forum - 11-14-2010, 12:12 PM
update query - by El Forum - 11-14-2010, 12:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB