I have an ajax call that fetches script 'getajax.php' from processing.
The call is called by the "getajax.php" script, which contains connection information for db, select, functions, etc.
My question is:
Each time a call is received by "getajax.php", it will go through mysql_connect, mysql_select, then the requests.
Is this the correct aproach to handle thousands of simultaneous calls?
How can I avoid opening a mysql connection on every call, reusing one existing connection for all calls.
Trying to have one call:
$dbconnect = mysql_connect('host','user','pass'); mysql_select_db('databasename') or die( "Unable to select database");
How can I open a persistent connection with the parent, so the 'getajax.php' script just reuses this connection without restarting these mysql commands again and again.
Not sure how to do this.
Thanks everyone!
source share