spsarolkar
02-12-2009, 11:29 AM
I am creating a forum website i have two tables as follows: -
table topic
login(primary key)
entrytime(primary key)
category
topic_name
table reply
reply_login(primary key)
reply_entrytime(primary key)
topic_login
topic_entrytime
reply_body
foreign key(topic_login,topic_entrytime)references topic(login,entrytime)
Now what i want to do is calculate no of replies for each category, if possible with single query , i have very rough knowlege of join
i am using mysql 5.x and php 5.2
table topic
login(primary key)
entrytime(primary key)
category
topic_name
table reply
reply_login(primary key)
reply_entrytime(primary key)
topic_login
topic_entrytime
reply_body
foreign key(topic_login,topic_entrytime)references topic(login,entrytime)
Now what i want to do is calculate no of replies for each category, if possible with single query , i have very rough knowlege of join
i am using mysql 5.x and php 5.2