Jump to content

Explode() help


Nostal

Recommended Posts

[code]
while($row = mysql_fetch_array($result)) {
echo "<tr><td width='40%' bgcolor='#666666'>";
echo "<div class='hbfield2'><a href='?cat=characters&id=$row[id]'>".$row[name]."</a></div>";
echo "</td><td width='40%' bgcolor='#666666'>";

while($row = mysql_fetch_array($result)) {
$series = explode(" ", $row[series]);

if ($series[0]=="1"){
$series[0] = "<div class='hbfield2'>Event Zero</div>";
}
else{
$series[0] = "";
}

if ($series[1]=="1"){
$series[1] = "<div class='hbfield2'>The Radicals</div>";
}
else{
$series[1] = "";
}

if ($series[2]=="1"){
$series[2] = "<div class='hbfield2'>The Paladins</div>";
}
else{
$series[2] = "";
}

if ($series[3]=="1"){
$series[3] = "<div class='hbfield2'>Event Zero, The Radicals</div>";
}
else{
$series[3] = "";
}

if ($series[4]=="1"){
$series[4] = "<div class='hbfield2'>Event Zero, The Paladins</div>";
}
else{
$series[4] = "";
}

if ($series[5]=="1"){
$series[5] = "<div class='hbfield2'>The Radicals, The Paladins</div>";
}
else{
$series[5] = "";
}

echo "$series";

}

echo "</td><td width='20%' bgcolor='#666666'>";
echo "<div class='hbfield2'>".$row[affiliation]."</div>";
echo "</td></tr>";
}
[/code]

Could anyone tell me what might be wrong with this code and also tell me what type of mysql table field type I would need to create a field for "0 0 0 0 0 0" where a "1" would mean it is "activated/on" kind of how binary functions?
Link to comment
https://forums.phpfreaks.com/topic/20994-explode-help/
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.