Account # of rows

Results 1 to 2 of 2
  1. #1
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Account # of rows

    PHP Code:
    <?php 
    $con 
    mssql_connect("***********","","");
    if (!
    $con){die('Couldnt not connect: ' mssql_error());}
    mssql_select_db("GunzDB");
    $acount mssql_query("SELECT count(*) FROM Account");
    echo 
    "$acount";
    mssql_close($con);
    ?>
    All I get is "Resource id #5"

    How do I get this to work?

    Nevermind, I figured it out:

    PHP Code:
    <?php 
    $con 
    mssql_connect("**********","","");
    if (!
    $con){die('Couldnt not connect: ' mssql_error());}
    mssql_select_db("GunzDB");
    $acount mssql_query("SELECT * FROM Account");
    $acount2 mssql_num_rows($acount);
    echo 
    "$acount2";
    mssql_close($con);
    ?>
    Last edited by V_o_o_d_o_o; 14-12-09 at 08:26 PM.


  2. #2
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: Account # of rows

    PHP Code:
    <?php 
    $con 
    mssql_connect("***********","","");
    if (!
    $con){die('Couldnt not connect: ' .mssql_get_last_message());} //The function mssql_error does not exists
    mssql_select_db("GunzDB");
    $c mssql_fetch_array(mssql_query("SELECT COUNT(*) AS total FROM Account"));
    echo 
    $c['total'];
    mssql_close($con);
    ?>
    Last edited by alfredao; 15-12-09 at 03:45 PM.



Advertisement