You could try modifying this (given to you in another topic)
Code:
$result = mysql_query("SELECT mytable1.name, mytable1.lastname, mytable2.shirtcolor FROM mytable1, mytable2
WHERE mytable1.lastname = mytable2.lastname") or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>name</th> <th>lastname</th> <th>shirtcolor</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['mytable1.name'];
echo "</td><td>";
echo $row['mytable1.lastname'];
echo "</td><td>";
echo $row['mytable2.shirtcolor'];
echo "</td></tr>";
}
echo "</table>";
Bookmarks