I cant figure out how to get comments underneath mysql db entries..
For example There is one article witch id is 1
and then there are some (for example 3) comments in that article (ID - 1) [ARTICLE_ID][CATEGORY]
And the comments are like: [ID][ARTICLE_ID]
..
so it is like
| ID | SUB_ID | TITLE....
| 1 | 123 | THIS IS A ARTICLE
| 2 | 1 | COMMENT TO ARTICLE 1
| 3 | 1 | COMMENT 2 to article 1
| 4 | 1 | Comment 3 to Article 1
AND CEN_TYPE for all of thesese IDs, 1,2,3,4 is forumentry
I've tryed like this:
- SELECT everthing from CNT_Entries_A WHERE CEN_TYPE is like
forumentry
- so everthing is fine here, but it doesnt put comments underneath (logically) - Putting all ID's AND SUB_ID's in to a array's
- making foreach cycle, inside that checking if current ID is equal to arrays value if it is, check if that ID is in array - if is not then printing it out and putting it to an array..
- SAME THING to SUB ID