Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: php n mysql

  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    137
    Thanks
    5
    Thanked 0 Times in 0 Posts

    php n mysql

    i am writing a WAp guest book... i need help writing a script which limits 25 posts viewing per page... to view the rest.... ppl shoul use next of previous button to see the post.... but from the same php file......

    i want it something like the google pages where u pres next to show the next results...

    heres my php code.... for the displaying posts




    PHP Code:
    <? header("Content-Type: text/vnd.wap.wml"); 
    echo 
    "<?xml version=\"1.0\"?>";
    echo 
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
    " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"?>

    <?php

    //open connection
    $connection mysql_connect("192.168.2.7""phpmysql_hmv22""harsha22");

    // Using the database
    mysql_select_db("phpmysql_guestbook",$connection);

    $get_posts "select id, name, date_format(entry_date, '%b %e') as post_time from guestbook order by entry_date desc";

    $get_posts_res mysql_query($get_posts,$connection) or die(mysql_error());

    // POSTS

    if (mysql_num_rows($get_posts_res) < 1) {
    // there are no posts
    $display_block "<big><b>No Records Found</b></big><br />
    <a href=\"add.php\">Click here to Sign GUEST BOOK</a>"
    ;
    } else {
    // create guestbook posts
    while ($post_info mysql_fetch_array($get_posts_res)) {
    $post_id $post_info['id'];
    $post_creater stripslashes($post_info['name']);
    $post_time $post_info['post_time'];

    $display_block .= "<a href=\"post.php?id=$post_id\">$post_time <big>:</big> $post_creater</a><br />";
    }
    }


    ?>


    <wml>
    <card>
    <?php echo $display_block?>

    </card>
    </wml>

    you can see the page here

    http://emulator.tagtag.com/wapemulat...v/wap/show.php

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,517
    Thanks
    114
    Thanked 110 Times in 109 Posts
    You need a pagination system. If you ask Ronaldb66 nicely he mentioned having one before.
    Last edited by timgolding; 02-28-2007 at 12:09 PM.
    You can not say you know how to do something, until you can teach it to someone else.

  • #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,073
    Thanks
    2
    Thanked 22 Times in 22 Posts
    Firepages posted a PHP pagination class a while back. Perhaps this will be what you need.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,037
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by vinyl-junkie View Post
    Firepages posted a PHP pagination class a while back. Perhaps this will be what you need.
    oppps never mind
    read the quote
    remove if you want


  •  

    Posting Permissions

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