Hi,
I need some newbie help in combining MySQL "select" with php "mysql_fetch_array" to display information in what you could call a n:m ratio.
I am trying to combine the fields "interests" and "members" by means of a join and displaying them in this way:
Interest1
Member1
Member2
Member3
Member4
Interest2
Member1
Member5
Interest3
Member5
Member6
The HTML is not important at the moment. I might choose to put the Interests between <h3></h3> tags and the members between <ul><li></li></ul> tags. My tables seem fine and the joins work fine, but I can't figure out the php necessary to do anything more complicated than display a 1:1 ratio or a 1:n ratio.
My code looks like this:
<?php
$sql3 = "SELECT interest, member FROM interests, members, rel_interests_members WHERE interests.interest_id = rel_interests_members.interest_id AND members.id_arbitrary = rel_interests_members.id_arbitrary ORDER BY interest";
$result3 = mysql_query($sql3);
while($item3 = mysql_fetch_array($result3)){
echo '?'
}
?>
"Echo '?' means: how should I proceed?
Thanks,
Roy G Biv