You have to specify your mysql database name, username and password when using mysql_connect. It is a PHP function, but you need to set the parameters in order to make it work.
See the manual:
http://uk2.php.net/manual/en/function.mysql-connect.php
Here is some code to help you (not mine, I found it in the user comments in the manual!)
<?
// db variables
// inserts variables accordingly
$host = "";
$user = "";
$pass = "";
$db = "";
$table = "";
// connecting to the db
$link = mysql_connect ($host, $user, $pass);
// the db query
$q = "SELECT * from $table";
$results = mysql_db_query ($db, $q, $link);
// fetching the results
while ($row = mysql_fetch_array($result)){
echo "$row[whatever]
$row[whatever2]
";
}
// closing the db link
mysql_close ($link);
?>