Seker Posted July 13, 2012 Posted July 13, 2012 Okay, so, as some of you have seen, I've been working on big mod. A re-work of the V1 items system. I've finally finished typing it all out and have moved on to testing it. I've hit a little snag with adding an item through the staffitems page I've created. I'm getting this error, and I don't understand why: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Weapon,Testing Info,10,1,1000,500)' at line 1 The item information form: echo " Use the forms below to enter the information for the new Weapon.<br /> All fields must be filled out.<br /><br /> <form action='staffitems.php?action=doaddweapon' method='post'> Weapon Type: (Projectile = 1, Melee = 2) <input type='text' name='type' value='' /><br /> Weapon Name: <input type='text' name='name' value='' /><br /> Weapon Info: <input type='text' name='info' value='' /><br /> Weapon Power: <input type='text' name='power' value='' /><br /> Weapon Sellable? (Yes = 1, No = 2) <input type='text' name='sellable' value='' /><br /> Weapon Price: <input type='text' name='price' value='' /><br /> Weapon Sell Price: <input type='text' name='sell_price' value='' /><br /> <input type='submit' value='Add Weapon' /></form>"; The SQL insert: mysql_query("INSERT INTO weapons VALUES('',{$_POST['type']},{$_POST['name']},{$_POST['info']},{$_POST['power']},{$_POST['sellable']},{$_POST['price']},{$_POST['sell_price']})", $c) or die(mysql_error()); Anyone see an obvious issue here? I've tried changing everything I can think of. Quote
Seker Posted July 13, 2012 Author Posted July 13, 2012 One: Strings should be wrapped in quotes. Weird. Worked. I just could have sworn I tried that, already. Thanks, though. Quote
Djkanna Posted July 14, 2012 Posted July 14, 2012 Weird. Worked. I just could have sworn I tried that, already. Thanks, though. Hehe, glad you got it working. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.