You are here: Re: How to debug PHP's mysql_query() function? « PHP Programming Language « IT news, forums, messages
Re: How to debug PHP's mysql_query() function?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация