Pagination

From: Date: Sun, 05 Dec 2004 15:17:10 +0000
Subject: Pagination
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-37590@lists.php.net to get a copy of this message
It shows next and the first 10 records but will not bring up the next 10 when next is pressed. <?php require ('db_params.inc'); if(!$start) $start = 0; $query2 = 'SELECT count(*) as count '
           . ' FROM Wellington '
           . ' WHERElocation="Hills"';
$result2 = mysql_query($query2); $row2 = mysql_fetch_array($result2); $numrows = $row2['count']; if($start > 1){ echo "<a href=\"" . $_SERVER['PHP_SELF']. "?start=" . ($start- 10) .
       "\">Previous</a><BR>";
} if($numrows > ($start + 10)){ echo "<a href=\"" . $_SERVER['PHP_SELF']. "?start=" . ($start + 10) .
      "\">Next</a><BR>";
} $query='SELECT * '
           . ' FROM Wellington '
           . ' WHERElocation="Hills" ORDER BY LotNo ASC LIMIT ' . $start. ',10';
           $result=mysql_query($query);
           while ($row = mysql_fetch_assoc($result)) {
       $location=$row['Location'];
       $ln=$row['LotNo'];
       $price=$row['Price'];
        $listing="<html>
        <head>
        </head>
        <body>
            <table align='center'>
             <tr>
           <td>$ln</td>
              <td> $location</td>
              <td>$price</td>
             </tr></table>
             </body></html>";
      echo $listing;
} ?> ----- Original Message ----- From: <php-db-digest-help@lists.php.net> To: <php-db@lists.php.net> Sent: Sunday, December 05, 2004 6:50 AM Subject: php-db Digest 5 Dec 2004 11:50:43 -0000 Issue 2714

« previous php.db (#37590) next »