[PHP] DB resource as Session var

2003-07-29 Thread Jackson Miller
I think I know the answer to this, but I have no technical reason to back it 
up.

Is it possible to store a db connection resource id as a $_SESSION variable?  
It would be nice to have one connection per user/session that carries over 
multiple page views.

I am guessing this is impossible, but if so I would like to know why.

Thanks,
-Jackson

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



Re: [PHP] DB resource as Session var

2003-07-29 Thread Peter James
Not possible, for many reasons.  Not the least of which is that db servers,
like any server, only have a limited number of connections.  Can you imagine
the havoc that multiple, session-wide, open connections would do to a db
server - even under light load?

Oh ya, plus it's absolutely impossible to persist any type of resource from
one request to the next.

Cheers,
Pete.

--
Peter James
[EMAIL PROTECTED]

php|architect
The Magazine for PHP Professionals
http://www.phparch.com


- Original Message - 
From: Jackson Miller [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 1:39 PM
Subject: [PHP] DB resource as Session var


 I think I know the answer to this, but I have no technical reason to back
it
 up.

 Is it possible to store a db connection resource id as a $_SESSION
variable?
 It would be nice to have one connection per user/session that carries over
 multiple page views.

 I am guessing this is impossible, but if so I would like to know why.

 Thanks,
 -Jackson

 -- 
 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