[eluser]alex646[/eluser]
Hey guys,
I would appreciate if somebody could clarify this for me:
I have a simple transaction:
Code:
$id = $data['id'];
$name = $data['name'];
$value = $data['value'];
$apikey = $data['apkey'];
$now = date("Y-m-d H:i:s");
//test transactions here
$this->db->trans_start();
$this->db->query("UPDATE data SET feed_name ='$name', feed_value='$value' WHERE feed_id = '$id'");
$this->db->query("UPDATE feeds SET date_updated ='$now' WHERE feed_id = '$id' AND apikey = '$apikey'");
$this->db->trans_complete();
return $this->db->trans_status() === FALSE ? FALSE : TRUE ;
//test transactions here
}
The problem with this transaction is that data is updated in data table but fails to update in feeds table. Should this transaction rollback and not update only one of the tables?
Thanks!!!