简体   繁体   中英

Select count(column) from table of mysql in php

I have a database and I am trying to make a website and connect it to my database. I am trying to count the number of instances in a column but I am having trouble. I have this so far:

$result =("SELECT COUNT(mediaID) FROM media WHERE 1;");

echo "The number of media posted on the system is ".$result."<br>";

I hope you have the connection done. Here something is column which you are using to filter the output as desired.

$result="select count(mediaID) from media where something="1"";
echo" the sentence".$result"."

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