I trying to follow along with an exercise from a php tutorial using a mySQL sample database called vinyldealers, which I put in my Webserver Documents folder (I'm using a Mac, I have no idea if that matters or not).
Here's the php I wrote to connect to the database...
<?php
$db = mysql_connect("localhost");
mysql_select_db("vinyldealers", $db);
$query = "SELECT * FROM shops";
$result = mysql_query($query);
$table = mysql_field_table ($result, 0);
echo $table;
?>
...which should, in theory, show the name of the table (shops) when I preview the page in a browser. Nothing is showing up. Did I write the script wrong or is it something mySQL specific, like the file being in the wrong place, etc.
Any help is greatly appreciated, thanks!