To interpret a normal PHP file (without using MySQL) it takes about 0.01 Milliseconds. But if you add mysql_connect()
or mysqli_connect()
or any other function to connect to a DB it takes much more time to interpret it. (usually about 1.05 Miliseconds).
I've tested so many times, the problem occurs when connecting to the database. No matter how many queries you run, they're super-fast. But Why connecting to a database is slower than querying from it.
What's the problem here ? What's the fastest way to connect to MySQL ?
I am using XAMP with Apache & MySQL on Windows 7