Try something like the following:
//Connect to your database
$host = "localhost";
$user = "phpuser";
$password = "secret";
$database = "your_db";
mysql_connect($host, $user, $password);
//Format your query statement -- note that
//table 1 and table 2 are joined using
//the field col_name1 which must exist
//in both tables and have matching values.
$query = "SELECT table1.col_name1, table1.col_name2, table2.col_name from table1, table2 where table1.col_name1 = table2.col_name1";
//Get your result -- I'm skipping things
//like error handling.
$result = mysql_query($query);
//Loop through your result set one row at a
//time and put the retrieved row into an
//array variable, $row_array
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$row_array = mysql_fetch_row($result);
//Print the results (do this inside an HTML
//table construct)
echo("<TD>$row_array[0]");
echo("<TD>$row_array[1]");
echo("<TD>$row_array[2]");
// etc. -- this is better done with another loop but, you probably get the idea.
}
?>