mysql parent id loop

afexar

New Member
I heve two Mysql tables\[code\]participantsid | name | lastname |-----------------------------1 | Jon | Bush |-----------------------------2 | Stephen | Eagle |\[/code\]and \[code\]postsid | parentid | Title | text--------------------------------------1 | 1 | Title1 | Text1---------------------------------------2 | 1 | title3 | text2---------------------------------------3 | 1 | title4 | text4--------------------------------------4 | 2 | title | ttext\[/code\]And I need get out table \[code\]--------------------------id (1) | Jon | Title1, title3, title4------------------------------id (2) | Stephen | title\[/code\]I try do this with\[code\]$result = mysql_query("SELECT name, Title, participants.id, parent FROM aposts, participants WHERE paricipants.id = parent.parent group by last_name ORDER BY .......");\[/code\]But in this cas I cant get loop on parent to get out all posts of this parent... Maybe someone can help me....
 
Back
Top