Sessions seems to kill db connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux