I am somewhat of a newbe in PHP.
I have a table called: "list"
with rows such as: "id", "user", "post"
Now I would like to pull together a query, so that I can get the following:
user1 - 13 posts
user2 - 42 posts
user3 - 84 posts
etc.
The number of posts will be the sum of all the posts that a certain member has.
Now this is what I have:
<?
$query = "SELECT * FROM list where user=$_GET[id]";
$result = MYSQL_QUERY($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$member = "$line[user]";
$post = "$line[post]";
$totalposts= count($post);
echo "$member - $totalposts posts<br>";
}
?>
It is not working... what am I doing wrong? Can somebody help?