MySQL counting question
Posted
by gew
on Stack Overflow
See other posts from Stack Overflow
or by gew
Published on 2010-05-21T05:09:25Z
Indexed on
2010/05/21
5:20 UTC
Read the original article
Hit count: 207
How do I find out which user entered the most articles and then count how many articles that user entered using PHP & MySQL.
Here is my MySQL tables.
CREATE TABLE users_articles (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
user_id INT UNSIGNED NOT NULL,
title TEXT NOT NULL,
acontent LONGTEXT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE users (
user_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
username VARCHAR(255) DEFAULT NULL,
pass CHAR(40) NOT NULL,
PRIMARY KEY (user_id)
);
© Stack Overflow or respective owner