Forum Moderators: coopster
<?
include('includes/db.php');
if(!$rowstart) $rowstart=0;
$result = "select * from users limit $rowstart,5";
$result2 = mysql_query("select * from users");
$numrows = mysql_num_rows($result2);
$results = mysql_query( $result );
if( $results )
{
while( $users = mysql_fetch_object( $results ) )
{
$username = $users -> username;
echo( "$username<br />" );
}
}
else
{
die( "Trouble getting contacts from database: " . mysql_error() );
}
if ($rowstart!= 0) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.($rowstart - 5).'">< Previous Page</a>';
}
if (($rowstart!= 0) && (($rowstart + 5) < $numrows)) echo ' ¦ ';
if (($rowstart + 5) < $numrows) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.($rowstart + 5).'">Next Page ></a>';
}
?>