Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: php doesn't load dynamic pagination

  1. #11
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <?php 
    mysql_connect("localhost", "root", "") or die(mysql_error()); 
    mysql_select_db("registration") or die(mysql_error()); 
    
    echo "var commentsbook={\n"; //Dynamically output javascript variable 
    $commentids=mysql_query("SELECT * from `users`"); //get IDs to last 5 comment pages 
    
    $idarray=array(); 
    while ($theid=mysql_fetch_array($commentids)){ 
      array_push($idarray, "'" . $theid[username] . "'");
    }
    
    echo "pages: [" . implode(",",$idarray) . "],\n"; //output: pages: [filepath1, filepath2, file
    echo "selectedpage: 0\n}"; 
    
    ?>
    that will echo the usernames but how about the pagination and limits to what is viewed on a page...thanks for the help btw

  2. #12
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Is that what you wanted?

    Or do you still need help?
    Jeremy | jfein.net

  3. #13
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    still need help...i was trying to do this but with the username...echo 5 users then move to next page...
    http://www.dynamicdrive.com/dynamici...nate/index.htm
    Last edited by contra10; 02-01-2009 at 02:15 AM. Reason: didnt display link

  4. #14
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.


    Also, can you provide all the code, including what's on index.php.
    Jeremy | jfein.net

  5. #15
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sry...how do i do that...kinda new...do i just post the link and all coding... here even though im on localhost?

  6. #16
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    If you on localhost, go ahead and make an account on Freehostia and upload your files there. You can just post all the coding too. Use the [ php ], [ html ], or [ code ] tag.
    Jeremy | jfein.net

  7. #17
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pagination

    all my files ar ethere
    http://localhost/test/

  8. #18
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Since your using a localhost you cannot share the link. It will simply go to my localhost. As I said before make an acount on Freehostia.
    Jeremy | jfein.net

  9. #19
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the takes forever to send registration email

  10. #20
    Join Date
    Feb 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok i have the code working at least aalittle bit...i can echo my results inbetween the pages...thing is now how do i link my pages to the results...i changed the variables to post as this was suppose to be for post origally

    Code:
    <div id="paginate-top"> </div>
    <div id="bookcontent">
    <?php 
    	
    if(is_numeric($_GET['page'])){
    
     $page = $_GET['page'];
    	}
    
    			mysql_connect("localhost", "root", "") or die(mysql_error()); 
    mysql_select_db("registration") or die(mysql_error());
    
    
    	$da = "SELECT * FROM post_profile WHERE userid = '1' ORDER BY ppid DESC LIMIT 10";
    $usposts = mysql_query($da) or die(mysql_error()); 
    
    //This is where you display your query results
    while($infoif = mysql_fetch_array($usposts)) 
    { 
    	$post= "{$infoif['post']}";
    	echo"$post<br>";
    	
    }
    
    ?>
    FINALLY ECHOING SOMETHING</div>
    <div id="paginate-bottom"> </div>
    
    
    <script type="text/javascript">
    
    <?php 
    mysql_connect("localhost", "root", "") or die(mysql_error()); 
    mysql_select_db("registration") or die(mysql_error()); 
    
    echo "var commentsbook={\n"; //Dynamically output javascript variable 
    $commentids=mysql_query("SELECT `ppid` from `post_profile` LIMIT 2"); //get IDs to last 5 comment pages 
    
    $idarray=array(); 
    while ($theid=mysql_fetch_array($commentids)){ 
      array_push($idarray, "'" . $theid[ppid] . "'");
    }
    echo "pages: [" . implode(",",$idarray) . "],\n"; //output: pages: [filepath1, filepath2, file
    echo "selectedpage: 0\n}"; 
    
    ?>
    
    
    
    var comments=new ajaxpageclass.createBook(commentsbook, "bookdiv", ["paginate-top", "paginate-bottom"])
    </script>
    </body>

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
  •