wantabe2
asked on
HTML / PHP Code Sorting
In the below code, it displays data from a mysql database in a browser. Is there any way for me to sort what is shown by the date?
<table>
<thead>
<tr>
<table border='7'>
<th>Customer No</th>
<th>First Name</th>
<th>Last Name</th>
<th>Order Date>/th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
require('connection.php');
if (isset($_GET['op']) && $_GET['op'] == "d")
if($_GET['op'] == "d" && !empty($_GET['id']) )
{
$query="DELETE FROM `psrinfo` WHERE `fid`=" . $_GET['id'];
$result = mysql_query($query) or die(mysql_error());
}
$query="SELECT fid, cust, fname, lname WHERE employee = 'employee1'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
?>
<tr>
<td><?php echo "".$row['cust']; ?></td>
<td><?php echo "".$row['fname']; ?></td>
<td><?php echo "".$row['lname']; ?></td>
<td><?php echo "".$row['date']; ?></td>
<td><a href="edit.php?id=<?php echo $row['fid'];?>"><center>Edit</center></a></td>
<td><a href="<?php echo $_SERVER['PHP_SELF'];?>?op=d&id=<?php echo $row['fid'];?>">Delete</a></td>
</tr>
<?php } ?>
</tbody>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.