Read carefully the mysql section of the manual, equipped with this basic outline.
Connect to the database using mysql_connect() and mysql_select_db().
Query the database using mysql_query(). This will return a result set that is available for further operations -- it won't be displayed automatically; you have to handle that.
Referring to the result set, retrieve one row at a time, repeatedly, until the result set "runs dry." Using the retrieved row, do something useful, like printing it out in table format.
Point 3 looks harder than it is, largely because there are multiple functions in the mysql_* group that do pretty much the same thing:
mysql_fetch_row
mysql_fetch_array
mysql_fetch_enum
mysql_fetch_obj
Pick the one that you feel produces the most readable code. I prefer mysql_fetch_object, which I'll use in the following example.
Imagine you have a db named "politics" containing a table named "issues." It has columns labeled "title" and "soundbite." Print them all in a table format.
// connect to mysql and select the db
mysql_connect("localhost", "georgew", "theshrub");
mysql_select_db("politics");
// query the db
$issues = mysql_query("select * from issues");
// process the results and print a table
echo "<table>";
while(mysql_fetch_obj($res))
{
echo "<tr>
<td>$issues->title</td>
<td>$issues->soundbite</td>
</tr>";
}
echo "</table>";