<?php
include("../dbconnect.php");
$info = mysql_query("SELECT * FROM requests");
echo '<table border="1" cellpadding="3" cellspacing="1">
<tr valign="top">
<td>Date</td>
<td>From</td>
<td>Subject</td>
<td>Message</td>
<td> </td>
<td> </td>
</tr>';
if (mysql_num_rows($info) < 1) {
echo '<tr valign="top">
<td colspan="4">There are no members that match the query. Please go back and try again</td>
</tr>';
}
else {
while ($qry = mysql_fetch_array($info)) {
//create the layout
?>
<tr valign="top">
<td><?php echo $qry['ID']; ?></td>
<td><?php echo $qry['date']; ?></td>
<td><?php echo $qry['from']; ?></td>
<td><?php echo $qry['subject']; ?></td>
<td><?php echo nl2br($qry['message']); ?></td>
<td><a href="?act=edit&id=<?php echo $qry['ID']; ?>">Edit</a></td>
<td>Delete</td>
</tr>
<?php
}
}
echo '</table>';
if ($_GET['act'] == 'edit') {
require("edit.php");
}
?>
|