Jump to content
Sign in to follow this  
Dubird

so, people good with mysql....

Recommended Posts

I have an error I can't find and it's driving me nuts. Everything looks right, but it keeps saying I have a syntex error. Here's the code:

$query = "INSERT INTO toys (name, cat, subcat, producer, license, location, year, size, price, paid, from, image, about) VALUES ('$name', '$cat', '$subcat', '$producer', '$license', '$location', '$year', '$size', '$price', '$paid', '$from', '$image', '$about')";
$result = @mysql_query($query) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());

And here's the query it comes up with (which, the post is doing it's job and putting the right words in the right places)

Query: INSERT INTO toys (name, cat, subcat, producer, license, location, year, size, price, paid, from, image, about) VALUES ('test2', 'calendar', '', 'fdasf', 'adsf', 'afds', '1234', 'fdasf', 'fdsadf', 'fdsaf', 'fdasfda', 'test2', 'fdsafa')

And here's the error:

Error: (1064) 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 'from, image, about) VALUES ('test2', 'calendar', '', 'fdasf', 'adsf', 'afds', '1' at line 1

help? *great big puppy dog eyes*


Yesterday was the deadline for all complaints!

acsig2016.jpg

Share this post


Link to post
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.

Guest
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.

Sign in to follow this  

×
×
  • Create New...