?
Solved

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

Posted on 2014-10-15
3
Medium Priority
?
247 Views
Last Modified: 2014-10-15
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
0
Comment
Question by:runnerjp2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 total points
ID: 40381901
The value $place lacks a leading apostrophe

... ng','$distance','$class',$place','$distance_bt'

should be

... ng','$distance','$class','$place','$distance_bt'
0
 

Author Closing Comment

by:runnerjp2005
ID: 40381925
Thanks ... tells me i need a break for lunch lol
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 40381943
:-)

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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, we’ll look at how to deploy ProxySQL.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question