I am curious about something. Speeding up how php connects to mysql.
I am using getmicrotime on my script and I notice generally my query usually takes somewhere around
0.0013 seconds
But, it sure seems slow! Unless microtime gives a false reading....I feel my script must be slow because the time it takes to connect to mysql
mysql is on the same machine as my script.
I am wondering if I am not connecting properly, or if I need to check apache configs or something like that. It really seems to take a long time.
I am connecting like this:
<?php
// Connect to the database server
$dbcnx = @mysql_pconnect("XXX", "XX", "XXX");
if (!$dbcnx) {
echo( "<p>Unable to connect to the database server at this time.</p>" );
exit();
}
// Select the jokes database
if (! @mysql_select_db("newcentury21") ) {
echo( "<p>Unable to locate the database at this time.</p>" );
exit();
}
?>
Please let me know if there is anything I can do to help speed this process up...or if there is anything I need to look for in the configs.