Database logic for conversation (like Forum) PHP, MySql -


i want create page possible create topics , users able comment.

i create table discussion recursive relation. don't if idea good.

how can find id of parent when user comment? don't if clear...

below find 3 screenshots explain better situation.

enter image description here

enter image description here

i not have parentid point comment precedes it, that's bad practice around. parentid should point topic , when selecting comments database, make query orders them time or id see order posted in.

for example...

select * `discussion` `parentid` = 1 order `time` desc; 

the parentid should null topics , not null (integer) replies (the integer should point id of topic). hope understood asking correctly.


Comments

Popular posts from this blog

php - How to serve a file for download on WordPress -

how to share virtual sharepoint server and get it in host windows and visual studio? -