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

[eluser]Rolly1971[/eluser]
i assume 'id' is the primary key? if so it should only affect 1 row if successful

Code:
function update_table($id, $value)
{
  $this->db->set('field', $value);
  $this->db->where('id', $id);
  return $this->db->update('table'); // returns true if successful, false otherwise
}


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