Hi, I want to display data from 2 tables(members, dvds), on 1 html table, so when the user views the data they see something like this (email and name from members, dvd_name from dvds);
Email | Name | DVD Name
hello@hello.com|A Nother| Spiderman
Except my code seems to print the data out as like this
Email | Name | DVD Name
hello@hello.com|A Nother|
Spiderman | |
This probably is something really trivial but if someone could help i would be most greatfull, my code is pasted below, thanking you in advance,
-AD
<html>
<body bgcolor=>
<P align=center> Current Rentals </p>
</br>
</br>
<?php
$db="test";
$link = mysql_connect("localhost");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$query = "SELECT FROM members";
$result = mysql_query($query);
$query1 = "SELECT FROM dvds";
$result1 = mysql_query($query1);
echo "<div align=center><table border=1 cellspacing=0>\n";
echo "<tr>
<td>E-mail</td>
<td>Name</td>
<td>DVD Name</td>
</tr>\n";
while ($row = mysql_fetch_array ($result)) {
echo "
<tr>
<td>{$row['email']}</td>
<td >{$row["first_name"]} {$row["second_name"]}</td>
";
}
while ($row1 = mysql_fetch_array ($result1)) {
echo "
<td >{$row1["dvd_name"]}</td>
<tr>
";
}
echo '</table>'
?>
</body>
</html>