Persistent database connection for Ajax Calls

insurancere

New Member
I have ajax call which pulls from the processing script 'getajax.php'.Call is made to 'getajax.php' script which has the db connection details, select, functions, etc.My question is:Everytime a call is received by 'getajax.php' it will go through mysql_connect, mysql_select, then queries.Is this the correct aproach to handle thousands of simultaneous calls?How can I avoid mysql connection to be opened everytime a call is made, reusing one existing connection for all calls.Trying to have one call to:\[code\]$dbconnect = mysql_connect('host','user','pass');mysql_select_db('databasename') or die( "Unable to select database");\[/code\]How can I open a persistent connection on parent so 'getajax.php' script just reususes this connection without running these mysql commands over and over.Unsure how to aproach.Thanks All!
 
Back
Top