- Forums
- MySQL
- How To Count How Many Times In A Row Are In Mysql Database
i will describe here how you can count the number of rows in a database using a mysql query using php code in a script [903], Last Updated: Sat May 18, 2024
wallpaperama
Sun Oct 05, 2008
1 Comments
1084 Visits
ok, if you are reading this post, im hoping you are here because you want to count how many rows are in your database with a specific value.
lets say you have a wallpaper website and you want to know how many times a member of your website has submitted a wallpaper.
well you can use this query example for counting the number of times the user "wallpaperama" has submitted a wallpaper.
you have a database able which is called "usersdb".
is the "usersdb" database, you have a field called "userid"
the "userid" for "wallpaperama" is equals to "345"
now that you have this information, you can send this query:
$sql = "SELECT COUNT(userid) AS TOTAL FROM users WHERE userid='345'";
$results = $myrwow['userid'];
when you execute this query, it will show you the number of times
hope this helps
https://www.wallpaperama.com/forums/how-to-count-how-many-times-in-mysql-database-t6429.html