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.'">&laquo;previous</a>&nbsp;';
 }else{
  echo '<a
href="'.$PHP_SELF.'?page='.($page-1).'">&laquo;previous</a>&nbsp;';
 }
} else {
 echo '<font color="#999999">&laquo;previous</font>&nbsp;';
}
while ($select_numrows > 0) {
 if ($page != $i) {
  if ($i==1){
   echo '<a href="'.$PHP_SELF.'">'.$i.'</a>&nbsp;';
  } else{
   echo '<a href="'.$PHP_SELF.'?page='.$i.'">'.$i.'</a>&nbsp;';
  }
 } else {
 echo '<font color="#999999">'.$i.'</font>&nbsp;';
}
 $i = $i+1;
 $select_numrows = $select_numrows-20;
}
if ($page < ($i-1)) {
 echo '<a
href="'.$PHP_SELF.'?page='.($page+1).'">next&raquo;</a>&nbsp;&nbsp;';
} else {
 echo '<font color="#999999">next&raquo;</font>&nbsp;&nbsp;';
}

   ?>


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]

Reply via email to