Thanks once again. I hope i am not taking up too much of your time.
I have run the code u sent & now all i get is
Test1()
Test2()
Test3()
it prints the topic name, but does not do the count.
The sql code that i am using is :
// formulate the SQL query
// i have changed the topics to TopicID
$query = "SELECT qnatopics.TopicID, qnatopics.TopicName, qnaquestions.TopicID, COUNT(*) FROM qnatopics, qnaquestions WHERE qnaquestions.TopicID = qnatopics.TopicID GROUP BY qnatopics.TopicID, TopicName" or die("Error in query");
// run the query on the database
$result = mysql_db_query($db,$query ,$connection)or
die("Error in query");
while($row = mysql_fetch_array($result)) {
print $row['TopicName']. "(" .$row['count']. ")<br>";
}
mysql_free_result($result);
I have run the above sql in phpmyadmin & display the correct info.