I use something like this
<?php
// this is the connector
$sql_server = "localhost";
$sql_username = "username";
$sql_password = "password";
$sql_database = "databasename";
global $sql_server;
global $sql_username;
global $sql_password;
global $sql_database;
$link = mysql_connect($sql_server, $sql_username, $sql_password)
or die("Could not connect : " . mysql_error());
mysql_select_db($sql_database) or die("Could not select database");
// this is the query
$query = mysql_query("SELECT * FROM 'yourtable'");
// this will make a table from your results with 3 columns
print "<table>";
print "<tr><td>column1</td><td>column1</td><td>column1</td></tr>";
// this will return rows of data until no more data is available - LIMIT x can be used to limit the number of rows returned (x is a number)
while ($row = mysql_fetch_array($query, MYSQL_NUM))
{
print "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td></tr>";
}
print "</table>";
?>