PDA

View Full Version : Ajax Pagination Script : php code error



acctman
11-10-2008, 05:34 PM
1) Script Title: Ajax Pagination Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/suppliment.htm

3) Describe problem: there is no closing bracet echo "var commentsbook={



<script type="text/javascript">

<?php

echo "var commentsbook={\n"; //Dynamically output javascript variable
$commentids=mysql_query("select id from comments order by date limit 5"); //get IDs to last 5 comment pages
$idarray=array();
while ($theid=mysql_fetch_array($commentids)){
array_push($idarray, "'http://www.mysite.com/comments.php?id=" . $theid[id] . "'");
}
echo "pages: [" . implode(",", $idarray) . "],\n"; //output: pages: [filepath1, filepath2, filepath3, etc],
echo "selectedpage: 0\n";

?>


var comments=new ajaxpageclass.createBook(commentsbook, "bookdiv", ["paginate-top", "paginate-bottom"])

</script>

ddadmin
11-10-2008, 11:36 PM
Thanks, I've corrected the supplementary page (http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/suppliment.htm) for this.