Code:
<div style="width: 400px; height: 700px;">
<?php
include('dbconnect.php'); //this will have you connection details.
$pp = "15"; //total comments per page
$total_comments = mysql_query("SELECT * FROM ".COMMENTS."");
$total =mysql_num_rows($total_comments);
$total_pages = ceil($total/$pp);
for ($i=0; $i<=$total_pages; $i++) {
$start = $pp * $i;
$comments = mysql_query("SELECT * FROM ".COMMENTS." LIMIT $start, $pp");
echo '<div class="virtualpage">';
while ($q = mysql_fetch_array($comments)) {
$test = $q['comment'];
?>
<div><?php echo $test;?></div>
<?php
echo '</div>';
}
}
?>
</div>
<!-- Pagination DIV for Demo 1 -->
<div id="gallerypaginate" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>
<!-- Initialize Demo 1 -->
<script type="text/javascript">
var gallery=new virtualpaginate("virtualpage", 1)
gallery.buildpagination("gallerypaginate")
</script>
It just displays all 27 comments on the first page.... second page and third page... I'm at a complete loss. Thank you for the help testingsite... i don't know what else to do !!!!!!!!!!!!!!!!!!!!!!
Bookmarks