Error Log states that I have MySQL connect error, yet script runs fine

Posted by rob - not a robber on Stack Overflow See other posts from Stack Overflow or by rob - not a robber
Published on 2010-04-09T14:11:48Z Indexed on 2010/04/09 14:13 UTC
Read the original article Hit count: 429

Filed under:
|

Hello All,

First, thanks for all the help I've received so far from StackOverflow. I've learned much.

Once again, I'm posing a rudimentary question that I've searched on, but cannot find the exact answer to. Here or on PHP.net.

It's sort of like what this guy asked, but not exactly: http://stackoverflow.com/questions/288603/mysql-throwing-query-error-yet-finishing-query-just-fine-why

So, I saw my errorlog ballooning up when I checked my site directory and opened to notice that a bunch of errors have been recorded since I wrote this new Admin area. I know something is obviously awry with my scripting for the error to be thrown, but the weird thing is, the script actually runs through and pulls all the data I need without breaking.

The log contains:

PHP Warning: mysql_query() [function.mysql-query]: Access denied for user 'someuser'@'localhost' (using password: NO) in /home/mysite/adminconsole.php on line 15

I don't get that because that very line is where I setup my connection... the exact same way I do it everywhere else on the site with no problem.

After that error, I have these thrown at the same time

[09-Apr-2010 08:44:18] PHP Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/mysite/adminconsole.php on line 15

[09-Apr-2010 08:44:18] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mysite/adminconsole.php on line 16

From what I read in the other guys thread, the problem is the contents of the query maybe? Maybe my query is malformed?

Thanks so much for any guidance you can provide.

-Rob

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql