[eluser]Ñuño Martínez[/eluser]
In my current project, I was writing a data insert but I wrote it wrong. It was something like:
Code:
$this->db->insert (array (
'id' => $IdData,
'stuff' => $SomeData,
'other_stuff' => $OtherData
));
If you don’t see it, I forgot to tell where I want to insert the data, so data are not inserted (database doesn’t change at all) but “$this->db->affected_rows ()” returned that one row was affected. Not error, not warning in log file, not exception thrown. I spend some time wondering why data wasn’t inserted until I realised that I forgot to add the table name.
I know that there are other ways to tell the table name, but it should return an error in that case, may be a “You forgot the tablename” or “Wrong datafields” (in my case, only one table has those fields, and as I’ve said it didn’t change). I think there’s a bug somewhere.
I’m using mysqli driver.