Jump to content

unable to solve You have an error in your SQL syntax;


runnerjp
Go to solution Solved by mac_gyver,

Recommended Posts

Im trying to add value into my database and i keep getting the following 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 '','','4','Telegraph (IRE)','3','9-3','','57','Evans, P D','28/1 ','Egan, John '' at line 1"

 


my query looks like this

mysqli_query($db,"INSERT INTO `Horses` (`Date`,`Track`,`Runners`, `Going`, `Distance`,`Class`,`Place`,`Losing_Dist`,`Stall`,`Horse`,`Age`,`Weight`,`Headgear`,`Horse_OR`,`Trainer`,`Odds`,`Jockeys_Claim`,`Comments`,`Race_Name` )VALUES ('$date','$place','$norunner','$going','$distance','$class',$place','$distance_bt','$stall','$horse','$age','$weight','$headgear','$OR','$trainer','$odds','$jockey','$comments','$event')")or die(mysqli_error($db));

and my table looks like this:

Column      Type      Null      Default
ID      int(255)      No      
Date      varchar(250)      Yes      NULL
Track      varchar(100)      Yes      NULL
Runners      varchar(50)      Yes      NULL
Going      varchar(50)      Yes      NULL
Distance      varchar(50)      Yes      NULL
Class      varchar(50)      Yes      NULL
Place      varchar(10)      Yes      NULL
Losing_Dist      varchar(50)      Yes      NULL
Stall      varchar(250)      Yes      NULL
Horse      varchar(50)      Yes      NULL
Age      varchar(50)      Yes      NULL
Weight      varchar(50)      Yes      NULL
Headgear      varchar(50)      Yes      NULL
Horse_OR      varchar(50)      Yes      NULL
Trainer      varchar(50)      Yes      NULL
Odds      varchar(50)      Yes      NULL
Jockeys_Claim      varchar(50)      Yes      NULL
Comments      varchar(250)      Yes      NULL
Race_Name      varchar(250)      Yes      NULL

Link to comment
Share on other sites

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.