update...

as a short test... i created a resource -->
 $link = mysql_connect(foo.....)

 and used the $link to process a query against my mysql db...

i then attempted to create a session var consisting of the $link value...
 $_SESSION['db'] = $link, and verified that it actually contained the
resource value.

the issue i have is that when i call the same page, the value in the session
var is no longer what it was. the other test session vars are still the same
values...

it appears that it's not possible (or i'm missing something) to
store/maintain mysql database resource information as a session variable...

i'm using php -v 4.2.2

am i missing something...

anybody have any idea as to why i might be seeing this kind of behavior..

thanks

-bruce


-----Original Message-----
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 10, 2004 2:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql and session vars...


hi...

if i create a site that hits a back mysql db...

i don't want to do a mysql_connect for every page that has to access the db.
so the question is where should the mysql_connect occur. also, if i were to
do it once when the app starts, is the connection more or less maintained
throught the life of the app.

an additional question. the resource identifier is required to initiate a
given php mysql function. i would assume that the resource identifier should
probably be stored in some session var....

searching mysql/php/google didn't result in clarfification for these
issues...

comments/criticisms/thoughts are welcome...

thanks

-bruce

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

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

Reply via email to