Sessions seems to kill db connection

From: Date: Thu, 22 Oct 2009 15:51:56 +0000
Subject: Sessions seems to kill db connection
Groups: php.general 
Request: Send a blank email to php-general+get-299223@lists.php.net to get a copy of this message
Hi PHPeople I have an odd problem at my new work and wonder if it's some sort of odd setup that is causing this problem when using sessions: if($test) { $query = "SELECT count(*) FROM articles WHERE group1 = 'fp'";# AND group2 = 'login'"; $r = mysql_query($query) or die('Db error: ' . mysql_error() . '<p>'.$SQL); print "There´s " . mysql_num_rows($r) . " rows"; // 3 rows print "session: " . $_SESSION['login']['uid']; // 1234 exit; } else { if($_SESSION['login']['uid']) {
    $query = "SELECT count(*) FROM articles WHERE group1 = 'fp'";# AND group2 = 'login'";
    $r = mysql_query($query) or die('Db error: ' . mysql_error() . '<p>'.$SQL);
    print "There´s " . mysql_num_rows($r) . " rows";
} } if $test is true it´s okay, if it´s false, this error occurs: 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. I've outcommented and login = to exclude a collision in variables (if register globals is on, haven't checked that yet) Anyone seen this wierd behaviour and know a solution or someway to test/debug this? -- Kind regards Kim Emax

« previous php.general (#299223) next »