I want to connect to MySQL using php. The code i've seen used in a lot of examples is along the lines of:
<?php
$username = "username";
$password = "password";
$hostname = "localhost";
$connection = mysql_connect($db_host, $db_username, $db_password);
if (!$connection){
die ("Could not connect to the database: <br />". mysql_error( ));
}
?>
Now, despite whether I assign a correct username/password pair, or an incorrect pair, all it does is send me to a blank page. I've tried making a query after putting in a correct username/password but nothing displayed on the page still. I don't get any errors, just a blank page.
Does anyone know what I could be doing wrong? I imagine i'd get an error if it couldn't find the mysql_connect function or something like that.
Thanks in advance,
-Raol