Jump to content

Recommended Posts

I can't seem to find anything wrong with it, but it keeps giving me this error:

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 'desc,img,vid) values('1','3','img/1299254331.PNG','2')' at line 1

 

My query:

include('includes/connect.php');
mysql_query("INSERT INTO ".$c[1]." (seed,desc,img,vid) values('$seed','$desc','$final','$vid')") or die(mysql_error());

:confused:

 

EDIT:

Nevermind, -apparently- you can't have a row called desc, or it thinks it means descending sort.

Link to comment
https://forums.phpfreaks.com/topic/229587-whats-wrong-with-my-sql-query/
Share on other sites

that's not the best practice, you should assign your SQL string to a variable and then execute the mysql_query() against the variable.  try this:

$qry ="INSERT INTO ".$c[1]." (seed, desc, img, vid) values('$seed', '$desc', '$final', '$vid')"; 
mysql_query($qry) or die($qry.'<br>Failed to run due to the following error :<br>'.mysql_error());

and see how you get on.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.