[英]How can I SELECT all table rows with data to display total number with data
I'm trying to show the total amount of say people with kittens. 我试图显示说有小猫的人的总数。
$query = mysql_query("SELECT * FROM people.kittens WHERE IS NOT NULL");
The issue is the field is not set to NULL
and is either blank or has data. 问题是该字段未设置为
NULL
并且为空或有数据。 Then I would show the total number with: 然后,我将显示总数:
$Totalpeoplewithkittens = mysql_num_rows($query);
I know mysql_query
is outdated. 我知道
mysql_query
已过时。 Just testing/learning. 只是测试/学习。
关于什么
$query = mysql_query("SELECT count(kittens) FROM people WHERE kittens > ''");
像从...选择计数(*)一样使用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.