Hi,
I don't think mysql_affected_rows() is working like it should for me.
In the manual for mysql_affected_rows() it has this (Example 1):
/* this should return the correct numbers of deleted records */
mysql_query("DELETE FROM mytable WHERE id < 10");
printf("Records deleted: %d\n", mysql_affected_rows());
However, when I do this:
$delete_assignment = mysql_query("DELETE FROM consultingprojectassign
WHERE workerid='$assigned[$i]'");
printf("Records deleted: %d\n", mysql_affected_rows());
It always says "Records deleted: 0". Even though the record was,
indeed, deleted. I have an if statement also that says if
mysql_affected_rows() < "1", then print an error message. Well, since
it always returns 0, no matter what, the error is always shown, even
when the record is deleted.
As I understand it, if no WHERE clause is in the query, then it will
automatically return a 0. As you can see, my query above does have a
WHERE clause. Can anyone help me out?
Thanks!!!
Best Regards,
--
Tyler Longren
J.D. Web Services, L.C.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php