View Single Post
Old 03-31-2006, 10:59 AM   #10 (permalink)
bayruni
Registered User
 
Join Date: Mar 2006
Posts: 9
bayruni is on a distinguished road
It works! I just had to add the count to my already created recordset, change a few things, and everything came out the way I wanted, thank God.

I searched many forums for help and this is the only one I had success in. Thank you so much, sde. You should write a tutorial regarding this topic. Your solution was the simples and most understandable one so far. I hate to think of the other ones!

In case another beginner runs into the same problem, I'm going to add my final query and the table column I had problems with. Who knows, it might be of use to someone.
<?$query_rsCategories = "SELECT *, COUNT(a.article_id) AS count FROM np_categories AS c LEFT JOIN np_articles AS a ON c.category_id=a.article_category_id GROUP BY c.category_id ORDER BY category_name ASC"; ?>
<td width="100"><p><?php echo $row_rsCategories['category_name']; ?> (<? echo $row_rsCategories['count']; ?>)</p></td>

Once again sde, thanks for your help. If you can spare some more time, please, can you just explain the the count query for me so I at least understand why it now works? I don't understand why you can use shortcuts like a and c for example.

Thanks again, very much, for your help.

Last edited by bayruni; 03-31-2006 at 11:23 AM.
bayruni is offline   Reply With Quote