gpt4 book ai didi

php - Mysql统计表中的行并返回一个整数

转载 作者:行者123 更新时间:2023-12-01 00:01:58 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Whats the best way to get total # of records in a mysql table with php?

当我运行时:

mysql_query("SELECT COUNT(col) FROM table"); 

我最终得到这样的结果:

(Resource) mysql result #4

我怎样才能只得到一个代表我表中行数的整数,以便以后我可以用它来进行简单检查,例如:$result < 10。

非常感谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com