Hello I have 2 tables named tbl_guard
and tbl_records
. The tbl_guard
has columns guard_id
and fullname
, while tbl_records
has guard_id
also. And here is my code:
$query = "SELECT * FROM tbl_records";
$stmt = $dbc->prepare($query);
$stmt->execute();
while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row);
echo "<table>";
echo "<tr>";
echo "<td>Name</td>";
echo "</tr>";
echo "<tr>";
echo "{$guard_id}";
echo "</tr>";
}
echo "</table>";
What I want to do is instead of the guard_id
being echoed there in the loop, I want the fullname
in the tbl_guard
table.
Your help would be very much appreciated!