On Feb 20, 2009, at 11:24 AM, Paul Will wrote:

Hi,

When I attempt to connect to a MySQL database I have noticed that the
initial connection is made using the "wwwrun" userid (this is the userid
that my Apache2 webserver is running under.)


This is the output I see from the Firefox "View Frame Info Function"

Notice: Undefined index:  db in /srv/www/htdocs/LMsummary.php5 on line
23
<br>

<snip>

Warning: mysql_connect(): Access denied for user 'wwwrun'@'localhost'
(using password: NO) in /srv/www/htdocs/LMsummary.php5 on line 28
<br>Unable to connect to MySQL server, check userid and password are correct.

However when I examine the values passed to the PHP script used in the mysql_connect() function I find that they are correct and as they should be, and it appears that for some reason details of the wwwrun userid is being passed to the mysql database prior
to the correct ones. Is this normal?

I should state that subsequent to this error the PHP connection to the MySQL server proceeds normally and the database is read OK and the pages are correctly compiled. The phpinfo() function also shows that the indexes apparently contain the correct values.

It would be helpful if you posted the actual connection code (with the credentials dummied out obviously). Otherwise, we all can only guess what's going on :)

The DB issue: If the values are not being properly passed to the connect function, php will use default values, but post the code if you need more support...

Index issue: index problem probably refers to using global variables e.g. $_GET. I googled "php list Notice: Undefined index:" and got http://www.dmxzone.com/go?13811 as my first hit. Check it out to see if that fits.

For faster, easier results next time, search your error on Google first - you may get an easy answer to a common question and avoid waiting for a response on the list.

Cheers!

Sean DeNigris
s...@clipperadams.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to