sngskunk
12-06-2005, 05:25 PM
Okay i have the code below so that it will show the information in the mysql database. The thing is, is this shows everything. I would like it to only show the latest 5. So what can i do to my script so that will happen. Thanks!
<?
include "class_db.php";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM site_roster";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$fname=mysql_result($result,$i,"fname");
$lname=mysql_result($result,$i,"lname");
$alias=mysql_result($result,$i,"alias");
?>
<b><a href="r_update.php?id=<? echo $id; ?>"><? echo $fname; ?> "<? echo $alias; ?>" <? echo $lname; ?></a></b><br>
<?php
$i++;
}
?>
Thanks Ahead!!!
<?
include "class_db.php";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM site_roster";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$fname=mysql_result($result,$i,"fname");
$lname=mysql_result($result,$i,"lname");
$alias=mysql_result($result,$i,"alias");
?>
<b><a href="r_update.php?id=<? echo $id; ?>"><? echo $fname; ?> "<? echo $alias; ?>" <? echo $lname; ?></a></b><br>
<?php
$i++;
}
?>
Thanks Ahead!!!
