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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.