I am beginner in MySQL. I have question about displaying data from two different table (same database), and list them based on their ID.
Recently, I am doing my project about creating simple discussion board (chat style) with features another user can comment to a post.
I have 2 tables,
Shoutbox -> Record a Discussion submit by an user
ID | Name | Text |
1 | Iqbal | This is Question |
2 | Zizan | Another Question |
Comment ->> Record a Comment from another user
ID | Comment |
1 | Answer for Iqbal |
1 | Another answer for Iqbal |
2 | Answer for Zizan |
How do I display Comment, according to Data in Shoutbox (based on their ID) ?
So, it should like this
Discussion Board
Iqbal : This is Question
Answer : Answer for Iqbal
Answer : Another Answer for IqbalZizan : Another Question
Answer : Answer for Zizan