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
  1. #1
    New to the CF scene
    Join Date
    Sep 2004
    Location
    about:blank;
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subtracting from SELECT Count(*) strings

    I'm trying to get php to subtract the output from a query count string. I've tried many various ways. And out of options, could anyone point me in the right direction? A guide.. or advice perhaps.

    I'm trying to subtract by 2, from the IPBoard members.

    code;

    PHP Code:
    <?php
    mysql_connect
    ("localhost","UUUUUUUU","PPPPPPP"); 
    mysql_select_db("DB_NAME"); 
    $query "SELECT COUNT(*) AS numrows FROM ibf_members";
    $nummembers mysql_query($query) or die("Select Failed!");
    $nummembers mysql_fetch_array($nummembers);
    ?>
    Members: <? echo $nummembers[0]; ?>
    Thanks for any help!

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    British Columbia
    Posts
    235
    Thanks
    0
    Thanked 0 Times in 0 Posts
    SELECT COUNT(*) - 2 AS numrows FROM ibf_members


  •  

    Posting Permissions

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