I apologize if this has already been discussed, however I could not find a thread that was the same problem as mine. I recently installed XAMPP with the intention of connecting PHP to a mySQL database to create some HTML form entry to enter data into tables. I am able to connect through the control panel to both Apache and mySQL. I created a file to test my connect to Localhost, however it is not doing anything, not even producing an error. I created this simple PHP connect file to try and test my connection:
- Code: Select all
<? php
$dbhost = 'localhost';
$username = 'root';
$password = '';
mysql_connect ("$dbhost" , "$username" , "$password");
echo"Successful connection";
?>
When I navigate to localhost/connect.php (file name is connect.php and stored in the htdocs folder in my XAMPP install) I simply get a blank page, it displays nothing. It does not return my echo statement nor an error. If I navigate to just localhost in my browser the XAMPP page will display. I am at a loss, the HTML form entry I created also does not work and does not successfully insert data into my database.
Any help would be greatly appreciated.
Thanks.