Trying to paginate a code but having trouble.
| From: | Chris Carter | Date: | Thu, 14 Feb 2008 18:38:19 +0000 |
| Subject: | Trying to paginate a code but having trouble. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-44603@lists.php.net to get a copy of this message | ||
Hi,
I am trying to paginate this to display just 4 results and use <Previous and
Next> options for pagination.
Please help.
<div class="content"><p><?php
// database information
include "includes/config.php";
$query="SELECT * FROM students LIMIT";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$a=mysql_result($result,$i,"a");
$b=mysql_result($result,$i,"b");
$c=mysql_result($result,$i,"c");
$d=mysql_result($result,$i,"d");
print'<div>
<div class="border">
<div class="sign"> '.$a.' '.$b.' </div>
<div class="Content"><strong>Name: </strong>'.$c.'<br
/>
<strong>Price:</strong> '.$d.' <br />
</div>
</div><br />';
$i++;
}
?>
Thanks in advance,
Chris
--
View this message in context: http://www.nabble.com/Trying-to-paginate-a-code-but-having-trouble.-tp15485452p15485452.html
Sent from the Php - Database mailing list archive at Nabble.com.