I'm using the following script to extract the category names from my databaseI also have a whole bunch of links stored in a table called "links" and I would like to count how many links are associated with category and display the number next to the category name. in the links table, I need to do aPHP Code:if (isset($userID)) {
$GetAllCats_result = mysql_query("SELECT cID, name FROM cats ORDER BY name ASC")
or die(mysql_error());
$GetAllCats = mysql_query($GetAllCats_result);
This is okay if I only want to count a particular category, but I can't work out how to join the 2 queries togther.PHP Code:if (isset($userID)) {
$GetAllCats_result = mysql_query("SELECT count(*) AS count FROM links WHERE lcID=cID GROUP BY lcID")
or die(mysql_error());
$GetAllCats = mysql_query($GetAllCats_result);
Ian




Bookmarks