i spent a good day learning how to do this from scratch. I'll post my code
and you can decypher it yourself.
<?php
$select_all = mysql_query("SELECT id FROM images WHERE
directory='original'");
$select_result = mysql_result($select_all,0);
$select_numrows = mysql_num_rows($select_all);
$i=1;
if (!isset($page)) {
$page = 1;
}
if ($page != 1 ) {
if (($page-1) == 1) {
echo '<a href="'.$PHP_SELF.'">«previous</a> ';
}else{
echo '<a
href="'.$PHP_SELF.'?page='.($page-1).'">«previous</a> ';
}
} else {
echo '<font color="#999999">«previous</font> ';
}
while ($select_numrows > 0) {
if ($page != $i) {
if ($i==1){
echo '<a href="'.$PHP_SELF.'">'.$i.'</a> ';
} else{
echo '<a href="'.$PHP_SELF.'?page='.$i.'">'.$i.'</a> ';
}
} else {
echo '<font color="#999999">'.$i.'</font> ';
}
$i = $i+1;
$select_numrows = $select_numrows-20;
}
if ($page < ($i-1)) {
echo '<a
href="'.$PHP_SELF.'?page='.($page+1).'">next»</a> ';
} else {
echo '<font color="#999999">next»</font> ';
}
?>
hope this helps. it took 2 days straight to debug and develope. obviously
you would use different database values though.
-Adam
god bless amarica
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]