简体   繁体   中英

How to count rows in a database

How do I count the rows in a database using PHP?

For example I have database called DB and a table inside called members . Inside the members table I want to count all rows to make a site statistics total number of members .

I use

$Profile = $core_db->Execute("Select ID, Name, Age, Nationality, Age from Profiles where Name='NAME'");

So I'm trying to count the number of names here.

$core_db->Execute("SELECT COUNT(ID) FROM Profiles WHERE Name='NAME'") .

Welcome to stack overflow, just a gentle reminder. You can always try to google first before posting your question here.

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