Jump to content

[SOLVED] For Ech problem.


Chevy

Recommended Posts

  $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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.