[php]<?
$host = "localhost";
$user = "me"
$pass = "super-secret";
$database = "db";
$table = "books";
//you need to put them in this order, the table name does not go here!
$db = mysql_connect ($host, $user, $pass) or die ('I cannot connect to the database because: ' . mysql_error());
//you must select a db, as all tables are in a database
mysql_select_db($db);
$sql_query = "SELECT * FROM $Table";
$result = mysql_query($sql_query);
if ($result == 0)
{
echo "I had a problem running the query!";
$number = 0;
}
else
{
echo "my sql query ran sucsessfully";
$number = mysql_num_rows($result);
}
mysql_close();
?>[/php]
you'll notice i put the mysql error number in case there was an error opening the database, I also checked to make sure usign the if statement, add all this extra junk to see where you are going wrong, and then once you figure it out then just clean it up a bit