" .
"- your MySQL server is running
" .
"- you used the correct hostname (vergil/ovid)
- " .
"
- you didn't forget the 'u' in the hostname
" .
"- you added a colon with your port number after the hostname
" .
"- you used the username 'root'
" .
"- you used the correct root password
" .
"- you didn't forget to close a set of quotation marks
");
print "Connected successfully.
";
$db = "mysql";
mysql_select_db($db) or die("Could not select the database '" . $db . "'. Are you sure it exists?");
// perform an SQL query
$query = "SELECT * FROM user";
$result = mysql_query($query) or die("Query failed");
// print the result of the first row (row counting starts at zero)
printf("Host: %s
\n", mysql_result($result, 0, "Host"));
printf("User: %s
\n", mysql_result($result, 0, "User"));
printf("Grant privilege: %s
\n", mysql_result($result, 0, "Grant_priv"));
// free result set
mysql_free_result($result);
// close the connection
mysql_close($link);
?>