I have 2 tables, members (id,name) and posts (id,title,text,posterid). I want to list the members by total posts.
1 problem, I don't have a number of total posts in the members table. I suppose I have to work with a join query.
So, I want something like this:
$total_posts = mysql_num_rows(mysql_query("SELECT * FROM posts WHERE posterid='$id'"));
mysql_query("SELECT * FROM members, posts WHERE members.id='$id' ORDER BY $total_posts");
I know this queries are not correct, but It's my way to express what I mean
Hope somebody can help me...