Re: Sessions seems to kill db connection

From: Date: Sat, 24 Oct 2009 08:28:27 +0000
Subject: Re: Sessions seems to kill db connection
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-299283@lists.php.net to get a copy of this message
Hi Kranthi kranthi wrote on 2009-10-24 07:27:
Db error: Access denied for user 'www-data'@'localhost' (using password: NO)
WTF? I´m not using a user called www-data for MySQL connections, but apache runs as this user
in the case where $test is true there is an open mysql connection, but when $test is false there is no open connection is available. may be you have opened a connection when $test is true or used a mysql_close() when $test is false or when $_SESSION['login']['uid'] is set.
I think you missed my words about resolving the matter, when you were cutting the quoted text :-)
regarding www-data, when mysql_query() fails to find a valid MySql connection, it tries to open a new connection with mysql.default_user and mysql.default_password (u can see these values trough phpinfo()); http://php.net/manual/en/function.mysql-connect.php
Thanks, that explained the www-data user -- Kind regards Kim Emax - masterminds.dk

« previous php.general (#299283) next »