Posted by Malcolm Dew-Jones on 11/02/05 21:16
John Moore (nobody@nomail.com) wrote:
: Hi
: I posted three days ago about a function I wrote which kept refusing
: to run a mysql_query.
: Well I did away with the function, and hard coded the variables into
: the query itself. Here's what I have now:
: mysql_query("UPDATE about SET category_id = 58 WHERE about_id = 5") or
: die('error: ' . mysql_error());
Are you sure you have a record with about_id = 5? It is not an error to
update zero rows. A successful update of zero rows is documented to
return TRUE from mysql_query.
You need to check the row count after running the query.
But I don't have an example handy of doing that, so you'll have to look it
up. I suspect that google can find examples of php mysql updates and
checking the row count afterwards.
--
This programmer available for rent.
Navigation:
[Reply to this message]
|