Jump to content

Singleton Connection to Database?


random1

Recommended Posts

I have a query that I use:

 

select VERSION() AS 'MySQL Version', DATABASE() as 'Database Name', USER() as 'Username & Host', CONNECTION_ID() as 'Connection ID'

 

It gets some info about MySQL.

 

On my site I have used a PHP singleton (one one database connection per user) database class to manage connections.

 

But the above query returns a new "Connection ID" each time the page loads (increments of 1).

 

Is this expected or does this mean that the singleton connection class is not working?  ???

Link to comment
https://forums.phpfreaks.com/topic/82966-singleton-connection-to-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.