List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:October 22 1999 8:29pm
Subject:Re: no errors reported in php
View as plain text  
At 12:09 PM -0700 10/22/99, Seth Tager wrote:
>Hello,
>
>I'm not getting any errors reported when I call
>mysql_query from a php script.
>
>The calls work fine (I get real db info) for valid sql, but
>when I put garbage in the query I dont get any errors
>reported in either mysql_error, mysql_errno, or php_errormsg
>(which is enabled in the .ini file)
>
>The only way I can tell that something didn't work is that
>the result of mysql_query is 0.
>
>Any idea why this is hapenning?
>
>Thanks
>Seth Tager
>

You might want to post this to the PHP list and add platform/php 
version/MySQL version info. However, I have had no trouble with 
mysql_error() on a WinNT/PHP3.0.11/Mysql 3.22.4 setup or a 
Solaris/PHP3.0.11/MySQL 3.23.something setup. Are you _sure_ that you 
have established a connection with mysql_connect() or _pconnect()? If 
not, you'll never get an error message in mysql_error() or _errno(). 
I believe you will get a connection error message in $phperrormsg 
(can't remember exact spelling), though. Also, do you call 
mysql_error() right after the mysql_query call? I don't know, but the 
mysql error message might be reset if you call other mysql API 
functions first. Lastly, have you tried using the mysql_db_query() 
statement instead of mysql_query() ? This is kind of a long shot, but 
maybe mysql_query() is buggy. I always use mysql_db_query().

-steve

+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg                           University of California, Davis |
| sbedberg@stripped                                     (530)754-9127 |
| Computer Consultant                         http://aesric.ucdavis.edu/ |
+---------------- said t e lawrence, picking up his fork ----------------+
Thread
no errors reported in phpSeth Tager22 Oct
  • Re: no errors reported in phpSteve Edberg22 Oct
    • Re: no errors reported in phpSeth Tager24 Oct