select count(*) as total from tab 

解决方案 »

  1.   

    select count(*) as total from tab 
    用的时候用
    rs("total")
    就OK 
      

  2.   

    接楼上
    $qid = mysql_query("select count(*) as total from tab ");
    $res = mysql_fetch_array($qid);
    $count = $res['total'];
      

  3.   

    $sql="select * from tab";
     $rs=@mysql_query($sql,@$Mylink);
     $count=@mysql_num_rows($rs);
      

  4.   

    不是这样的吗?
    $result = mysql_query("select count(*) from tab");
    list($count) = mysql_fetch_row($result);
      

  5.   

    select count(*) as total from tab