[nycphp-talk] mysql + 0 rows affected error
Dan Cech
dcech at phpwerx.net
Mon Jan 12 16:48:26 EST 2004
That does sound very odd, though you would have to provide more details
to be able to properly diagnose the problem.
I do know that affected rows will return the number of rows actually
changes by an update, so if you set a value to the value it currently
has it will not be counted.
As for a DELETE, it will return 0 affected rows if you do not specify a
WHERE clause. This is due to an internal speed optimisation, if you
don't specify a where clause (in autocommit mode) it actually performs a
TRUNCATE on the table.
I don't know if this helps you much, but they are the only cases I can
think of where you should get an affected_rows value of 0. If your
queries do not fall into one of these categories then there is
definitely something fishy going on.
Dan
jon baer wrote:
> greetings ...
>
> i am wondering if this is a client/server incompatibility issue or not,
> maybe someone has had the same issue ... when connected to mysql cli and
> performing an update or delete on a table i seem to always get "0 rows
> affected" in which the case is not true (confirmed by a followed select) ...
>
> it also seems to be problematic with the mysql_affected_rows() function.
>
> is there something else i should check?
>
> - jon
>
> pgp key: http://www.jonbaer.net/jonbaer.asc
> fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
More information about the talk
mailing list