RE: [PHP] Pulling Certain Data
| From: | Tyler Replogle | Date: | Tue, 06 Apr 2004 22:58:21 +0000 |
| Subject: | RE: [PHP] Pulling Certain Data | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-182564@lists.php.net to get a copy of this message | ||
hey,
trying putting at where in your "SELECT * FROM $main_tbl" so it looks like this
SELECT * FROM $main_tbl where "whatever" = "somthing"
you can also make a limit in "SELECT * FROM $main_tbl" just like this
SELECT * FROM $main_tbl LIMIT 4
From: "Jason T. Davidson" <chief@zmpartcc.com> Reply-To: <chief@zmpartcc.com> To: <php-general@lists.php.net> Subject: [PHP] Pulling Certain Data Date: Tue, 6 Apr 2004 14:40:38 -0500 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>_________________________________________________________________ Check out MSN PC Safety & Security to help ensure your PC is protected and safe. http://specials.msn.com/msn/security.asp<td><font size="5">ZMP Rosters</font><font size="5"> - <fontsize="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"><fontsize="3"><strong>CONTROLLER</strong></font></div></td><td width="60"><div align="center"><fontsize="3"><strong>CID</strong></font></div></td><td width="100"><div align="center"><fontsize="3"><strong>RATING</strong></font></div></td><td width="130"><div align="center"><fontsize="3"><strong>POSITION</strong></font></div></td><td width="130"><div align="center"><fontsize="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