Jump to content

Issue with adding item


Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...