select count(*) as count from table
echo rs["count"];

解决方案 »

  1.   

    在PHP中最最简洁统计表中记录总数应该怎么写?我只会用:$result = mysql_query("select * from table");
    $row = mysql_num_rows($result);echo $row;
      

  2.   

    $result = mysql_fetch_array(mysql_query("select count(id) from table"));
    $row = $result[0];echo $row;
      

  3.   

    也就是得到总记录数:$sql= 'select count(*) as count from table ';$re=mysql_query($sql);$rs=mysql_fetch_array($re);echo rs["count"];
      

  4.   

    很多人?什么人群?
    我觉得这是最基本的SQL函数了