PDA

View Full Version : [Help]Web Mysql Coding -Need Assistance


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.

ConnorJack
10-15-2009, 09:40 PM
Bit of misc advice, in your first like, query is spelt wrong

butsags
10-15-2009, 10:37 PM
lol i know. personal reasons, jk it just to keep from confusion from upper rows of coding. i assure you its on purpose