RE: [PHP] Persistent Links help needed

2002-03-13 Thread Ford, Mike [LSS]

> -Original Message-
> From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]]
> Sent: 13 March 2002 00:51
> 
> Hi All,
> I have multiple PHP pages and make my connection to the MySQl 
> db in one of
> these pages.  When I go to the next one any mysql  commands 
> seem not to work
> - it look like the connection to the DB is lost!  I have a 
> feeling this is
> to do with persistent connections so here is the relevant parts of the
> phpinfo() output.
> My question is - what do I have to set and how do I do it so 
> the connection
> remains

You can't -- it doesn't work like that.

 or do I have to reconnect in every php file?? 

Yes -- there is no way to have a connection that persists between scripts.

A persistent connection is only persistent as far as your Web server's connection to 
MySQL is concerned -- the advantage is that the Web server doesn't have to remake the 
connection each time a script demands it.  A non-persistent connection, however, is 
completely dropped when you close it (either explicitly or by default when your script 
terminates), so that subsequent scripts requiring an identical connection have to bear 
the cost of starting up a whole new connection to MySQL.  As far as your script is 
concerned, you can do nothing with persistent connections over and above what you can 
do with non-persistent ones -- the difference is purely in how (often) the server 
makes and breaks the connections.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] Persistent Links help needed

2002-03-12 Thread WG4- Cook, Janet

Hi All,
I have multiple PHP pages and make my connection to the MySQl db in one of
these pages.  When I go to the next one any mysql  commands seem not to work
- it look like the connection to the DB is lost!  I have a feeling this is
to do with persistent connections so here is the relevant parts of the
phpinfo() output.
My question is - what do I have to set and how do I do it so the connection
remains or do I have to reconnect in every php file?? 
MySQL Support   enabled 
Active Persistent Links 0   
Active Links1   
Client API version  3.23.33 
MYSQL_INCLUDE   
MYSQL_LFLAGS
MYSQL_LIBS  

Directive   Local Value Master Value
mysql.allow_persistent  On  On  
mysql.default_host  no valueno value
mysql.default_password  no valueno value
mysql.default_port  no valueno value
mysql.default_socketno valueno value
mysql.default_user  no valueno value
mysql.max_links Unlimited   Unlimited   
mysql.max_persistentUnlimited   Unlimited   

Thanks
Janet Cook


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