Sounds like you need a where clause in your sql query: $r1="SELECT * FROM $main_tbl where status='A'";
replace 'status' with whatever you called the status field in your table.
Keith
At 12:40 PM 4/6/2004, Jason T. Davidson wrote:
Community-
I am a first time databaser and am having trouble pulling information from a database to display on a site. Not every entry is supposed to show up on the web page, but does so. I have tried IF statements without any help. Here is what I have so far:
<?
$r1="SELECT * FROM $main_tbl";
$rsql=mysql_query($r1,$db);
?>
<body text="#000066" link="#000066" vlink="#000066" alink="#000066">
<table width="600">
<tr>
<td>
<font size="5">ZMP Rosters</font><font size="5"> - <font size="2"><a href="http://www.vatusa.org/html/modules.php?op=modload&name=PN_Content&file =index&req=visit&artid=26">VATUSA listing</a></font></font></td>
</tr>
</table>
<br></br>
<table width="600">
<tr>
<td>
<font size="5">Active Controllers</font></td>
</tr>
</table>
<table width="600">
<tr bgcolor="#999999">
<td width="180"><div align="center"><font size="3"><strong>CONTROLLER</strong></font></div></td>
<td width="60"><div align="center"><font size="3"><strong>CID</strong></font></div></td>
<td width="100"><div align="center"><font size="3"><strong>RATING</strong></font></div></td>
<td width="130"><div align="center"><font size="3"><strong>POSITION</strong></font></div></td>
<td width="130"><div align="center"><font size="3"><strong>DATE JOINED</strong></font></div></td>
</tr>
<?
while ($a_row=mysql_fetch_array($rsql))
{
?>
<tr bgcolor="#CCCCCC">
<td width="180" align="left"><font size="2"><? echo "$a_row[LNAME], $a_row[FNAME]";?></font></td>
<td width="60" align="center"><font size="2"><? echo "$a_row[CID]";?></font></td>
<td width="100" align="center"><font size="2"><? echo "$a_row[RATING]";?></font></td>
<td width="130" align="center"><font size="2"><? echo "$a_row[POSITION]";?></font></td>
<td width="130" align="center"><font size="2"><? echo "$a_row[JDATE]";?></font></td>
</tr>
<? }
?>
</table>
</body>
I would like to only show people who are active within our roster and within the database I have identified those people by putting a "A", "I" or "L" depending on their status with our organization. I guess I am looking for a way for the code to see how that person is labeled and then put them in the proper roster.
www.zmpartcc.com/roster/roster.php
--
Jason T. Davidson
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php