losing MySQL resource
| From: | Stan | Date: | Sat, 19 Sep 2009 10:11:06 +0000 |
| Subject: | losing MySQL resource | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-46516@lists.php.net to get a copy of this message | ||
I'm maintaining a session. I successfully connect to a database ($DBConnect
= mysql_connect()). I save the connection resource in a session variable
($_SESSION['connection'] = $DBConnect) ... to use in subsequent queries. It
remains valid while the user is on the current page.
print_r($_SESSION['connection']) yields 'Resource id #3', for instance.
User browses to a new page ... in the same session. $_SESSION['$DBConnect']
no longer references a valid mysql resource.
print_r($_SESSION['connection']) yields '0'.
Other "ordinary" values saved in $_SESSION variables remain valid.
Is there something special about a mysql resource?