Below is my code for two pages. Dashboard.php has an html table filled with 7 columns populated by my database. All are populated without any problem. In an 8th column, I have a hyperlink that says 'View'. When clicked, I want that hyper link to use the value in the serialNumber column and then when it opens up the Display.php page, I need my html tables to be filled by database values based on that serial number.
My query in display.php is meant to get the stageID from my staging table that corresponds with the serialNumber in the row where the hyperlink was clicked.
i.e., if the user hits 'View' on the row with 988809 as the serialNumber, the query should match that serial number in my staging table and select everything with that stageID and then fill my tables.
The debug statements for $_GET do echo the correct serialNumber from the line/link chosen, but on display.PHP, I only get my echo statements, no tables or data. How can I change my hyperlink or query to fix this?
Dashboard.PHP
<?php
include 'connectionDB.php';
$query1 = "SELECT * FROM staging;";
$result1 = mysqli_query($connect,$query1);
?>
<div class="dashboardTable">
<table style="border: 1px solid black;">
<tr>
<th>Work Order Packet</th>
<th>Work Order Number</th>
<th>Date</th>
<th>Utility</th>
<th>Service Name</th>
<th>Address</th>
<th>Serial No.</th>
</tr>
<?php
while($row = mysqli_fetch_array($result1)){
?>
<tr>
<td><? echo $row['workOrderPacket'];?> </td>
<td><? echo $row['workOrderNum'];?> </td>
<td><? echo $row['date'];?> </td>
<td><? echo $row['utility'];?> </td>
<td><? echo $row['serviceName'];?> </td>
<td><? echo $row['address'];?> </td>
<td><? echo $row['serialNumber'];?> </td>
<td><a href="Display.php?serialNumber=<? echo $row['serialNumber'];? >">view</a></td>
</tr>
<?}?>
</table>
</div>
Display.php
<?php
if(isset($_GET['serialNumber']))
{
$query1 = "SELECT * FROM staging WHERE stageID = ".$_GET['serialNumber'].";";
$result1 = mysqli_query($connect,$query1);
while($row = mysqli_fetch_array($result1)){
?>
<div class="container">
<!--Title Line-->
<DIV class="title">
<h3>REPORT TITLE</h3>
</DIV>
<div class="TitleContainer" style="width: 100%;">
<!--Column 1 for header info-->
<DIV class="headerCol1">
<table style=" float: left; border:none;
border-collapse:collapse;">
<tr style="border: none;">
<th style="border: none; text-align: left;">Account:</th>
<th style="border: none; text-align: right;"><? echo $row['accountNum'];?> </th>
</tr>
<tr style="border: none;">
<td style="border: none; text-align: left;">Date/Time:</td>
<td style="border: none; text-align: right;"><? echo $row['date'];?>, <?echo $row['timeTested'];?> </td>
</tr>