butsags
10-15-2009, 08:02 PM
Ok im trying to fill a gap. idk how to code mysql realy
so im trying to have an image of a weapon come up and im trying to tell the script that if the character doesnt have any of this type of weapon, to use another image to fill in the gap
php is being used as the base
heres what i have so far:
$queryy = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -101");
while($row = mysql_fetch_array($queryy));
$amount = mysql_num_rows($queryy);
if ($amount > 0) {
$equipt = $row[itemid];
echo "
<img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\">";
}
else {
echo " <img src=\"".$styledir."/images/none.png\"STYLE=\" WIDTH:32px; HEIGHT:32px\">";
}
I'm very new to mysql coding so im having a hard time figuring out how to get this to work. any help would be overly appreciated.
so im trying to have an image of a weapon come up and im trying to tell the script that if the character doesnt have any of this type of weapon, to use another image to fill in the gap
php is being used as the base
heres what i have so far:
$queryy = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -101");
while($row = mysql_fetch_array($queryy));
$amount = mysql_num_rows($queryy);
if ($amount > 0) {
$equipt = $row[itemid];
echo "
<img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\">";
}
else {
echo " <img src=\"".$styledir."/images/none.png\"STYLE=\" WIDTH:32px; HEIGHT:32px\">";
}
I'm very new to mysql coding so im having a hard time figuring out how to get this to work. any help would be overly appreciated.