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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    count function for site

    I need to know if anyone knows a member count code to be displayed via PHP, I am storing all membership info in a database, Need a count function on my table and get the number of records.

    Thanks

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    PHP Code:
    $link mysql_connect("localhost""mysql_user""mysql_password");
    mysql_select_db("database"$link);

    $result mysql_query("SELECT count(id) FROM members_table"$link);
    $num_rows mysql_num_rows($result);

    echo 
    "You have ".$num_rows." members\n"

  • #3
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    count function for site

    Thank you for the info


    Now to put this on table what file would I insert this code?


  •  

    Posting Permissions

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