Else If statement not workin
Posted: Sun Aug 26, 2007 6:38 pm
Hey
Here's part of my code where the else if starts
the console image is displayed ($platform1)
Okay so for some reason it keeps showing the image images/consoles/old/ps3.gif next to each screenshot instead of the correct image depending on what the database has it as.
Ive tried everything.
Any ideas?
Here's part of my code where the else if starts
Code: Select all
$theplatform=$row[platform];
$platform1='0';
if ($theplatform=ps3) { $platform1="images/consoles/old/ps3.gif"; }
elseif ($theplatform=psp) { $platform1="images/consoles/old/psp.gif"; }
elseif ($theplatform=x360) { $platform1="images/consoles/old/x360.gif"; }
elseif ($theplatform=ds) { $platform1="images/consoles/old/ds.gif"; }
elseif ($theplatform=wii) { $platform1="images/consoles/old/wii.gif"; }
else { echo "nothing."; }
//fill the array with your data
$mydata[] = "<table class=\"myown\" cellpadding=\"0\" border=\"0\" align=\"center\"><tr><td colspan=\"2\" $tdreg><center><img border=\"0\" src=\"thumbnailer.php?image=" .$row['url'] ."&type=Media\" border=\"0\"></center></td></tr><tr><td colspan=\"2\" $tdreg2>$row[title] <img src=\"$platform1\"><td></tr><tr><td $tdreg>Updated:</td><td $tdreg>$row[date]</td></tr></table>";
}Okay so for some reason it keeps showing the image images/consoles/old/ps3.gif next to each screenshot instead of the correct image depending on what the database has it as.
Ive tried everything.
Any ideas?