I tried but can't seem to make it work! Any ideas would be great!
PHP Code:
<?php
/* connect to the mysql database and use different queries for the count of members */
include 'config.php';
include 'open.php';
//navigation
include("nav.php");
$info = mysql_query("SELECT *, (select count(*) from tblmembers where tblmembers.ID = tblrepresentatives.rep_NBR) as total_members FROM tblrepresentatives");
echo '<table border="1" cellpadding="3" cellspacing="1">
<tr valign="top">
<td>First Name</td>
<td>Last Name</td>
<td>Members</td>
<td>Edit</td>
</tr>';
$result = mysql_query($query);
//now check it for failure and display a decent error message if it did fail
if (!$result) {
die("Query failed. Query text: $query<br />Error Message: ".mysql_error());
}
else {
while ($qry = mysql_fetch_array($info)) {
//create the layout
?>
<link href="cs_style.css" rel="stylesheet" type="text/css" />
<tr valign="top">
<td><?php echo $qry['rep_Firstname']; ?></td>
<td><?php echo $qry['rep_Lastname']; ?></td>
<td><?php echo $qty['total_members']; ?></td>
<td><a href="showAdminEdit.php?record_id=<?php echo $qry['id']; ?>">Edit</a></td>
<td>Delete</td>
</tr>
<?php
}
}
echo '</table>';
include 'library/closedb.php';
?>
Bookmarks