Вот один из возможных способов:
<?php
$dbcon = mysql_connect("localhost","user","password");
if (!$dbcon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_name", $dbcon);
$query_result = mysql_query("SELECT * FROM MyTable");
while($result_array = mysql_fetch_array($query_result))
{
echo $result_array['column1'] . " " . $result_array['column2'];
echo "<br />";
}
mysql_close($dbcon);
?>