Tak for det hurtige svar. Jeg ved ikke om jeg har misforstået det.
Nu har jeg lavet det sådan:
Config
$q = 1;
$x = 1;
$wear_query = "SELECT * FROM wear WHERE ID='$_SESSION[id]'";
$wear_result = mysql_query($wear_query)or die("MySQL fejl: " . mysql_error());
$wear = mysql_fetch_array($wear_result);
$query = array();
$query[1] = mysql_query("SELECT * FROM items WHERE ID='$wear[Head]'")or die("MySQL fejl: " . mysql_error());
$query[2] = mysql_query("SELECT * FROM items WHERE ID='$wear[Armor]'")or die("MySQL fejl: " . mysql_error());
$query[3] = mysql_query("SELECT * FROM items WHERE ID='$wear[Rhand]'")or die("MySQL fejl: " . mysql_error());
$query[4] = mysql_query("SELECT * FROM items WHERE ID='$wear[Lhand]'")or die("MySQL fejl: " . mysql_error());
while($q<="4"){
if (($row[$x]['Præfix']) != "0" and($row['Præfix']) != "") { $prefix[$x] = '<br />'.$row['Præfix'].'<br />'; } else { $prefix[$x] = ""; }
if (($row['Mindam']) != "0" and ($row['Maxdam']) != "0" and ($row['Mindam']) != "" and ($row['Maxdam']) != "") { $dmg[$x] = '<br /><font color=#CC0000>Damage:</font> '.$row['Mindam'].'-'.$row['Maxdam']; } else { $dmg[$x] = ""; }
if (($row['Armor']) != "0" and ($row['Armor']) != "") { $armor[$x] = '<br /><font color=#CC0000>Armor:</font> +'.$row['Armor']; } else { $armor[$x] = ""; }
if (($row['Money']) != "0" and ($row['Money']) != "") { $money[$x] = '<br /><font color=#CC0000>Money:</font> +'.$row['Money'].' <font color=#0033CC>p/½h</font>'; } else { $money[$x] = ""; }
if (($row['Rage']) != "0" and ($row['Rage']) != "") { $rage[$x] = '<br /><font color=#CC0000>Rage:</font> +'.$row['Rage'].' <font color=#0033CC>p/½h</font>'; } else { $rage[$x] = ""; }
if (($row['Chakra']) != "0" and ($row['Chakra']) != "") { $chakra[$x] = '<br /><font color=#CC0000>Chakra:</font> +'.$row['Chakra']; } else { $chakra[$x] = ""; }
if (($row['Strenght']) != "0" and ($row['Strenght']) != "") { $strenght[$x] = '<br /><font color=#CC0000>Strenght:</font> +'.$row['Strenght']; } else { $strenght[$x] = ""; }
if (($row['Agility']) != "0" and ($row['Agility']) != "") { $agility[$x] = '<br /><font color=#CC0000>Agility:</font> +'.$row['Agility']; } else { $agility[$x] = ""; }
if (($row['Charisma']) != "0" and ($row['Charisma']) != "") { $charisma[$x] = '<br /><font color=#CC0000>Charisma:</font> +'.$row['Charisma']; } else { $charisma[$x] = ""; }
if (($row['Skill']) != "0" and ($row['Skill']) != "") { $skill[$x] = '<br /><font color=#CC0000>Bonus:</font> +'.$row['Skill']; } else { $skill[$x] = ""; }
$wornitem[$x] = '<img src="'.$row['Image'].'"
title="'.$row['Name'].$prefix[$x].$armor[$x].$dmg[$x].$money[$x].$rage[$x].$chakra[$x].$strenght[$x].$agility[$x].$charisma[$x].$skill[$x].'
<br />
<br /><div id=unequip>(Click to unequip)</div>
" />';
$q++;
$x++;
}
Output
<div class="inv_head"><?php echo $wornitem1; ?></div>
<div class="inv_rhand"><?php echo $wornitem3; ?></div>
<div class="inv_armor"><?php echo $wornitem2; ?></div>
<div class="inv_lhand"><?php echo $wornitem4; ?></div>
og nu er der ingen errors, men den viser ikke nogen billeder.
Indlæg senest redigeret d. 16.09.2008 22:38 af Bruger #14181