April 24, 201115 yr Ok I have a script which gathers and splits friend results. Which is below: $friends = mysql_query("SELECT friends FROM members WHERE username = '".$_SESSION['uname']."'"); while($row = mysql_fetch_array($friends)){ $people = explode(" ", $row['friends']); if(num_rows($people) > 5){ echo 'true'; } else { } foreach($people AS $person){ $result = mysql_query("SELECT photo FROM members WHERE username = '".$person."'"); while($row = mysql_fetch_array($result)){ echo '<td><div class="photofile"><fieldset><legend>'.$person.'\'s Profile</legend><a title="'.$person.'" href="profiles.php?username='.$person.'"><img src="thumb.php?file='.$row['photo'].'&size=140x80"></a></fieldset></div></td>'; } } } Now I need it to display 4 table results per line. i don't have time to give u a full solution cause im on my way out the door but i can tell u explode is used for creating an array and $row['friends'] is already an array so no need to use expload if u wanna join array elements together u can use implode(",",$row['friends']);
April 24, 201115 yr Author i don't have time to give u a full solution cause im on my way out the door but i can tell u explode is used for creating an array and $row['friends'] is already an array so no need to use expload if u wanna join array elements together u can use implode(",",$row['friends']); Thanks man
Create an account or sign in to comment