looking for simple script to read database for members

Discussion in 'PHP' started by dougvcd, Jan 18, 2008.

  1. #1
    hi all
    am looking how to put on a page total members =
    which reads database and tells how many members there are
    i have a rough idea
    make a variable say mem$
    let mem$= 0
    let mem$=mem$+1
    total members = mem$
    i want to put it on the first page of my web site which is the index
    cheers
    Doug
     
    dougvcd, Jan 18, 2008 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    $sql = "select count(*) from members";
    $st = mysql_query($sql) or die(mysql_error());
    echo "<p>The forum has " . mysql_result($st, 0, 0) . " members. Put that in your pipe and smoke it.</p>";
    
    PHP:
     
    SmallPotatoes, Jan 18, 2008 IP
  3. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you that workes a treat
    cheers
    Doug
    ;)
     
    dougvcd, Jan 18, 2008 IP