this is some code that's suppose to parse multiple page when getting data, but it's just printing it a bunch of times.
can anyone see what the problem is?PHP Code:<?php
$db_connect = mysql_connect (host, username, password);
$dbname = "databasename";
///////////////////////////////////
// Parse multiple pages section. //
///////////////////////////////////
$count = 1;
$numcols = 3;
$limit = 7;
$sqlcount= "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$sqlcount.=" WHERE is_admin=0 AND verify=1";
$sql_countresult = mysql_db_query($dbname, $sqlcount, $db_connect);
$totalrows = mysql_num_rows($sql_countresult) or die(mysql_error());
if(empty($page)){
$page = 1;
}
$limitvalue = $page*$limit-($limit);
$sql = "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$sql .= " WHERE is_admin=0 AND verify=1 LIMIT $limitvalue, $limit";
$sql_result = mysql_db_query($dbname, $sql, $db_connect);
while ($row = mysql_fetch_array($sql_result)){
// This section houses the html and php that i use to print the memberlist. You can see this code at this link:
// www.3dartisan.net/htmldata.txt
<?
}
echo "<BR>";
if($page != 1) {
$pageprev= $page - 1;
echo "<font color=\"#FFFFFF\" size=\"2\"><A HREF=\"$PHP_SELF?page=$pageprev\">";
echo "<b><< Prev</b></A></font><font color=\"#0000FF\" size=\"2\"> [</font>";
// if page is not equal to one, prev goes to $page - 1
}
else {
echo "<font color=\"#FFFFFF\" size=\"2\"><b> << Prev </b></font><font color=\"#0000FF\" size=\"2\">[</font>";
}
$numofpages = $totalrows/$limit;
for($i= 1; $i < $numofpages; $i++) {
if($page == $i) {
echo "<font size=\"2\"> $i </font>"; //make number navigation
}
else{
echo "<font size=\"2\"> <A HREF=\"$PHP_SELF?page=$i\">$i</font></A> "; //make number navigation
}
}
if($totalrows%$limit != 0) {
if($page > $numofpages) {
echo "<font size=\"2\"> $i </font>"; //make number navigation
}
else{
echo "<font size=\"2\"> <A HREF=\"$PHP_SELF?page=$i\">$i</font></A> "; ////if there is a remainder, add another page
}
}
if(($totalrows-($limit*$page)) > 0){
$pagenext = $page + 1;
echo "<font size=\"2\" color=\"#0000FF\">] </font><A HREF=\"$PHP_SELF?page=$pagenext\"><font size=\"2\"><b>Next >></b></A> ";
// if the totalrows - $limit * $page is > 0 (meaning there is a remainder), leave the next button.
} else {
echo "<font color=\"#0000FF\" size=\"2\">]</font><font color=\"#FFFFFF\" size=\"2\"> <b>Next >> </b></font>"; }
mysql_free_result($sql_result);
mysql_close ($db_connect);
if ($date_y==2001){
$if_date = "Copyright © 2001";
} else {
$if_date = "Copyright © 2001-$date_y"; }
?>
<br>
<br>
<font size="1" face="verdana" color="#FFFFFF">3dartisan.net and all of it's contents are <?php print "$if_date"; ?><br>
All user user submitted work is © it's respective author.</font>
</center>
</body>
</html>





Bookmarks