This is my code that i am working on for my little rpg store thing. It is suppose to allow others to create shops. This is just a portion where they can change the prices there items are for
I am having trouble allowing them to change the prices, could someone please look through my code and tell me about any errors?
Id appreciate it.
//Inventory stuff
if ($view == inventory) {
print "You inventory";
print "<table><tr><td width=50><b><u>Name</td><td width=100><b><u>Desc</td><td><b><u>Options</td></tr>";
include("language/item.php");
$esel = mysql_query("select * from equipment where status='S' and owner=$stat[id]");
while ($equip = mysql_fetch_array($esel)) {
print "<tr>
<td><img src=\"images/items/".$equip['name'].".gif\"></td>
<td><b>".$equip['name']."</b> <br>Price: $equip[price]<br>".$desc[$equip['name']]." </td>
<td><a href=\"item.php?remove=$equip[id]\">Remove</a><br>
<form method=post action=shop.php?view=inventory&id=$equip[id]&step=price>
<input type=text value=$equip[price] name=np>
<input type=submit value=Update>
</td>
</tr>";
}
print "</table>";
}
if ($step == price) {
{
$sql = "UPDATE equipment SET price='".$np."' WHERE id=$equip[id] and owner=$stat[id]";
mysql_query("$sql");
print "You have updated your $equip[name] from $equip[price] to $np. ";
}
}
?>
Thanks alot,
-Dusk