Link to home
Start Free TrialLog in
Avatar of Member_2_5230414
Member_2_5230414

asked on

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

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
ASKER CERTIFIED SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_5230414
Member_2_5230414

ASKER

Thanks ... tells me i need a break for lunch lol
:-)

Sometimes a fresh pair of eyes is all that is needed. Thanks for the points and enjoy your lunch