I have some drop down lists that contain values and when the user selects the serial number and hits submit, it posts to Display.php and the tables on that page successfully fill with the values from the database. I've now added a table on the page with the dropdowns that creates a table filled with all entries from the database.
The table populates correctly, and there is a 'View' Hyperlink at the end. I want this to open Display.PHP also, but I want the tables on that page to fill from the database corresponding to the 'View' link selected, rather than the submit button. When I run the following code with the isset($_POST)
line (from Display.php) and use the dropdown and Submit button option, it populates the tables with the record attached to the serial number from the drop down.
But when I comment that out and use the isset($_REQUEST)
line, I just get a blank Display.php page except for my successful connection message. Is there an issue somewhere with the way I'm calling the request?
dashboard.php
<body>
<?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>
</body>
Display.php
<?php
if(isset($_GET['serialNumber']))
{
$query1 = "SELECT * FROM staging WHERE stageID = ".$_REQUEST['serialNumber'].";";
$result1 = mysqli_query($connect,$query1);
while($row = mysqli_fetch_array($result1)){
?>
////////HTML Tables here