select count(*) as total from user 
再取出total字段的值。

解决方案 »

  1.   

    谢谢各位了,现在是单张表统计总数的问题解决了,但将两张表加起来统计却实现不了,且看我的sql语句:
    $gboog=mysql_query("select count(*)+(select count(*) from qgus) as num from hhhh")
    $algnum=mysql_numrows($gboog); //统计求购、转让信息总数
    上面的sql语句运行时出现错误,应该怎么写才正确呀!
      

  2.   

    select count(distinct a.id1)+count(distinct b.id2) from table1 a,table2 b
    首先要保证两个表的id都是主键,也就是在每个表里具有唯一性,才可以用
      

  3.   

    lsrzm(月影飞鸿--我要分、分、分.....) 
    学习了一招,测试通过了