View Full Version : Ajax Pagination Script : php code error

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">


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
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"])


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