Page lister
Page Lister
0): #We actually got some rows.
echo "\n
\n";
for($i = 1; $i <= $NUMPAGES; $i++): #loop to print << 1 2 3... $NUMPAGES >>
if($i == 1 && $PAGE > 1) #Prints the << first to goto the previous page (not on page 1)
echo "« ";
if($i == $PAGE) #Doesn't print a link itself, just prints page number
echo " $i ";
if($i != $PAGE) #Other links that aren't this page go here
echo " $i ";
if($i == $NUMPAGES && $PAGE != $NUMPAGES) # Link for next page >> (not on last page)
echo " »";
endfor;
echo "\n
\n";
echo "\n";
$START = ($PAGE - 1) * $DISPPAGE;
mysql_data_seek($QRETURN,$START); #Moves the pointer to right row
#This loop will go until you a) reach $DISPPAGE or b) there aren't anymore entries
for($i = 1; $i <= $DISPPAGE && $ARET = @mysql_fetch_array($QRETURN); $i++):
$VAR = $ARET["col"]; #******** Here's the bit you should update! ********#
echo "$VAR\n
\n\n"; #echoes the field...
# Alternately, if you feel like numbering. I haven't tested this.
#echo "".$START + ($i - 1).": $VAR\n
\n\n";
endfor;
echo "\n";
endif;
if($QNUM == 0) #if we get no rows
echo "The database is empty
\n";
endif;
if(!$QRETURN): # Bogus Query, or mysqld isn't running...
echo "\n";
echo "\n";
echo "Either the database is down, or the query was invalid\n";
echo "\n
\n";
endif;
?>