[eluser]bleu[/eluser]
[quote author="CroNiX" date="1336412575"]Also, if you are updating, affected_rows() will only return a positive number if the data actually changes. If it doesn't change, the update doesn't actually take place even thought the query is "successful".
So if the data was:
id:21
name:Bill
and you do an update setting the name to 'Bill' for id 21, no update will take place.
One thing you aren't checking, is the result of $update to see whether there was an error or not. It will return TRUE if the query was successfully run and FALSE if there was an error. Check for an error first before checking to see if the update had affected_rows().[/quote]
I have tried running it in phpmyadmin and it gives me the proper 0 or 1 rows affected as per the data.But when i run it through codeigniter I get -1 even when The value to be updated has changed or remained same
The query is true always in codeigniter
Is it because I have turned on codeigniter mysqli drivers