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

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -