Chevy Posted August 24, 2007 Share Posted August 24, 2007 $trophies = explode(",", $site_array[trophies]); echo '<center><br><font size="4"><b><u>Trophies</u></b></font><br><table width="250><tr>'; if ($site_array['trophies'] == NULL){ echo '<td align="center"><font color="red"><b>'.$site_array['name'].' has no trophies!</b></font></td>'; } $i = 0; foreach($trophies as $trophy){ $trophy_select = mysql_query("SELECT * FROM `trophies` WHERE `shortname`='$trophy'"); $trophy_array = mysql_fetch_array($trophy_select); $i = $i+1; echo '<td align="center"><img src="'.$trophy_array['image'].'"><br><b>'.$trophy_array['name'].'</b></td>'; if ($i == "2"){ echo '</tr><tr>'; $i = 0; } } That code only puts out one thing when I have 3 in the database field My DB for that one site looks like this... gold,feautured,friendliest It only is displaying Gold Link to comment https://forums.phpfreaks.com/topic/66502-solved-for-ech-problem/ Share on other sites More sharing options...
Jessica Posted August 24, 2007 Share Posted August 24, 2007 Try this: $trophies = explode(",", $site_array[trophies]); print_r($trophies); and see what it shows. Link to comment https://forums.phpfreaks.com/topic/66502-solved-for-ech-problem/#findComment-333019 Share on other sites More sharing options...
Chevy Posted August 24, 2007 Author Share Posted August 24, 2007 Array ( [0] => gold [1] => feautured [2] => friendliest ) This doesn't make since, they are all there..? Link to comment https://forums.phpfreaks.com/topic/66502-solved-for-ech-problem/#findComment-333021 Share on other sites More sharing options...
Chevy Posted August 24, 2007 Author Share Posted August 24, 2007 Ah, I checked my other table it might be a problem there, hold on :-P -Edit- Yea it was the other table. Thanks for the help Link to comment https://forums.phpfreaks.com/topic/66502-solved-for-ech-problem/#findComment-333023 Share on other sites More sharing options...
Jessica Posted August 24, 2007 Share Posted August 24, 2007 No problem Link to comment https://forums.phpfreaks.com/topic/66502-solved-for-ech-problem/#findComment-333024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.