Codeigniter setting multiple where conditions, how to unset one
Posted
by Dustin
on Stack Overflow
See other posts from Stack Overflow
or by Dustin
Published on 2010-05-12T19:48:26Z
Indexed on
2010/05/12
22:14 UTC
Read the original article
Hit count: 190
I've got a script that is a notify_url from paypal that is supposed to update multiple tables in my database using the following code:
//update first table
$this->db->where('someid', $somid);
$this->db->update('table', $data);
///update second table
$this->db->where('somesecondid', $somesecondid)
$this->db->update('anothertable', $data2);
Then I get the following error: Unknown column 'somesecondid' in 'where clause'
UPDATE anothertable
SET avail
= 0 WHERE someid
= '13' AND somesecondid
= '199'
So codeigniter is combining those where clauses into a single query. Is there a way to unset the first one so it only has "UPDATE anothertable SET avail=0 WHERE somesecondid = 199" ? Thanks!
© Stack Overflow or respective owner