Results 1 to 2 of 2

Thread: Ajax Pagination Script : php code error

  1. #1
    Join Date
    Jul 2006
    Posts
    64
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Default Ajax Pagination Script : php code error

    1) Script Title: Ajax Pagination Script

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

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

    PHP Code:
    <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>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Thanks, I've corrected the supplementary page for this.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    acctman (12-11-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •