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 2 of 2

Thread: row count down

  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    row count down

    hi
    i have this script that will count the number of rows witch is working but say if i had a number of 100 and i had 3 rows how can i make the number 100 count down so the number 100 now would be 97 etc.. and keep counting down to 0 as the number of rows increase thanks...



    PHP Code:
    include("db.php");
    $result mysql_query("SELECT * FROM users");
    $num_rows mysql_num_rows($result);
    echo 
    $num_rows;
    ?> 
    Last edited by ycpc55; 04-23-2012 at 07:21 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,297
    Thanks
    23
    Thanked 612 Times in 611 Posts
    This can not be this simple, but I don't know what you mean by count down.
    Code:
    <?php
    $num_rows = 3;
    echo $num_rows.'<br />';
    $new_num = 100 - $num_rows;
    echo $new_num;
    ?>


  •  

    Posting Permissions

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