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 Colin McKinnon on 11/02/05 23:04

John Moore wrote:

>
> $update = mysql_query("UPDATE about SET category_id=63 WHERE
> about_id=5") or trigger_error(mysql_error(), E_USER_ERROR);
> if (!$update) {
> echo 'Error: ' . mysql_error();
> }
> echo '<hr>Info: ';
> mysql_info($update);
> echo '<hr>';
>
> mysql_info returns a warning:
>
> Warning: mysql_info() expects parameter 1 to be resource, boolean
> given in c:\Path\to\script.php on line 384
>

Well, you're running it on MS-Windows - thats not good for starters.

Try switching on the replication log in mysql and see if it changes size /
timestamp when you run the query (you can also convert the log to a
readable format - RTFM for more details).

mysql_info(), like all the mysql_ fns should use the default...according to
the manual (same for both _info & _query):

: If by chance no connection is found or established,
: an E_WARNING level warning is generated.

....but of course you read that already. It seems most peculiar that the
script is getting that far the way you've written it (the connection exists
at line 1, becuase you're not getting a fatal error, yet nothing is
(allegedly) getting updated, then there is no connection at line 5. I guess
your installation might be fscked.

C.

 

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

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