简体   繁体   中英

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. Then I would show the total number with:

$Totalpeoplewithkittens = mysql_num_rows($query);

I know mysql_query is outdated. Just testing/learning.

关于什么

$query = mysql_query("SELECT count(kittens) FROM people WHERE kittens > ''");

像从...选择计数(*)一样使用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM