For a schoolproject we have to make a website that interacts with a myphp database. We want to pull data from two different tables in the database, but when we try to echo the data, only data from the first table is shown. Out two tables are: TICKET and VISITOR This is our code:
include 'login.php';
$sql = mysql_query("SELECT * FROM TICKET VISITOR ",$mysql)
or die("The query failed!");
mysql_close($mysql)
or die("Closing the connection failed!");
if (!$sql) {
echo 'Could not run query: ' . mysql_error();
exit;
}
echo "<br/>";
while ($row = mysql_fetch_row($sql)) {
echo $row[0];
echo " ";
echo $row[1];
echo " ";
echo $row[2];
echo "<br/>";
}