Hey all. I was previously a cold-fusion developer, and now I am brand new to PHP. This is also the first time I set up the the web server myself. I am running Apache, MySQL, and PHP off a new Win2000Pro machine (due to company politics).
This is my problem: Anything written in html or non-database interactive php loads instantly, as expected. This means any static HTML page, or a php-imbedded page that catches variables from a form and displays them. These are lighting fast- just as soon as I hit the submit button the next page loads.
HOWEVER, any page that interacts with the mySQL database takes MUCH LONGER. I mean, I hit submit and wait like 2 or 3 seconds before the results page to load. I'm not talking about complicated joins or huge inserts. Just the MOST BASIC, simple queries like looking for a single record based on ID number, or updating a single record. An example of my query is below:
<?php
mysql_connect (localhost, webuser, webpassx);
mysql_select_db (test);
$selectresult = mysql_query ("
SELECT * FROM JUNKIT
WHERE FNAME LIKE '$_POST[fname]'
");
?>
What am I doing wrong? Did I put the database in a non-optimal location? Am I not connecting to the database correctly? Please help.
Thanks-
J