I've changed the line of code you suggested and the error I've got is:
"No database selected"
I specified this in a seperate dc connect php file.
Can anyone shed any light on this?
I've just looked at my dbconnect.php file and it doesn't have a database name in there, (well it does, but it was commented out). Can someone explain how I should properly implement this connection please?
Here's the dbconnect.php file code:
What I'm a little unsure of is where I'm supposed to say "connect to this database", "select from that table" etc, I don't know how I should be separating these bits of code.
$username = "test";
$password = "test";
$hostname = "localhost:/tmp/mysql5.sock";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
//select a database to work with
$selected = mysql_select_db("makeagre_test",$dbhandle)
or die("Could not select examples");
Any help would be greatly appreciated.