Hi,
I have this sql_query code on my message board front page:
$amount = mysql_query("SELECT p.*, t.ID FROM posts p, topics t WHERE p.TopicID=t.ID");
$num_rows = mysql_num_rows($amount);
and to print it out I have the <?php echo $num_rows ?>
The 2 tables looks the following way:
Table posts:
ID int(5) PRI NULL auto_increment
TopicID int(5) 0
timestamp timestamp(14) YES NULL
user_ varchar(10) YES NULL
Post text
Table topics
ID int(5) PRI NULL auto_increment
TopicName varchar(50)
and what I'm trying to achieve is to display the amount of posts each topic holds, but with that current search it displays the amount of all the posts made..
any ideas?
Thanks,
-T
Start Free Trial