I have a feeling I've done this before but I can't remember exactly how it's done. This is the while loop so far:
include ('includes/DbCon.php');
$dir = 'images/photo/';
$query = "select * from news";
$result = $mysqli->query ($query);
echo "<table border='0' class='newsTable' style='width:70%;margin:0em auto;'>";
echo "<tr stlye='display:block;margin:0em auto;'><th>Date</th><th>Headline</th><th>Body</th><th>Image</th></tr>";
while ($row = $result->fetch_assoc())
{
echo "<tr><td>";
echo date('j/M/y', strtotime($row['newsDate']));
echo "</td><td>";
echo "<a href='newsItem.php?id=".$row['id']."'>".$row['headline']."</a>";
echo "</td><td>";
echo "<a href='newsItem.php?id=".$row['id']."'>" . $row['body'] . "</a>";
echo "</td><td>";
echo "<p><img src=".$dir.$row['image']." width='100' height='100' alt=''> </p>";
echo "</td></tr>";
echo "<th colspan=\"4\"><hr width=\"90%\"></th>";
}
echo "</table>";
$mysqli->close();
I tried making the select statement:
select * from news, reviews
But it only brought the items from the reviews table.
I tried looking up the php manual but couldn't find it. I have to set up all the variables for the second table (reviews), don't I?