0

I am posting a load of information to this file, and then trying to upload the information into the 'Cars' Table. I know the table works as I have tried single values and it worked.

I added all the values and now it throws 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 '`,`CurrColour`,`NoOfDoors`,`SeatingCap`,`Length`,`Width`,`Height`,`CombEngCap`,`' at line 2"

 ... "INSERT into `Cars`
            (`date`,`DVLAMake`,`DVLAModel`,`BodyStyle`,`EngineSize`,`Year`,`Transmission`,FuelType`,`CurrColour`,`NoOfDoors`,`SeatingCap`,`Length`,`Width`,`Height`,`CombEngCap`,`DriveType`,`MaxTorque`,`MaxPower`,`FuelConsumpURB`,`FuelConsumpCOMB`,`MaxSpeed`,`Acceleration`,`WeightKG`,`NCAPRating`,`SecRemCentLock`,`SecCentLock`,`SecAlarm`,`SecImmob`,`AudioEquip`,`ExtPowerAssSteer`,`ExtAssBreak`,`ExtElecWindows`,`ExtAirBags`,`ExtMirrors`,`ElecHeatedMir`,`IncWarranty`,`IncSerBook`,`IncMOT`,`IncPXConsid`,`CarImage`)
            VALUES
( ... ) ";

Any ideas?

4
  • Mr Mombassa, where is line 2? and please spent some effort to make your question more readable Commented Mar 19, 2012 at 13:47
  • 1
    You are missing a backtick before FuelType ... Commented Mar 19, 2012 at 13:48
  • MySQL error messages are usually pretty informative. Look at the context where it says there is an error: ',CurrColour,' The comma character you've got there looks different to the previous ones. Are you using a non-ASCII comma to separate some of the fields? Commented Mar 19, 2012 at 13:51
  • @liquorvicar: No, that's the website interpreting the backticks as code snippets. As @dleiftah mentioned already, he is missing a backtick before FuelType. Commented Mar 19, 2012 at 13:53

2 Answers 2

2

You are missing a backtick before FuelType ... The error message clearly shows you where your error is ...

Sign up to request clarification or add additional context in comments.

2 Comments

I corrected that, and it now jumps to the end : :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 'ScreenShot003.png')' at line 4 Screenshot is the value being passed through: VALUES (...'$PXConsidered','$image')";
You may want to echo the query before executing it to see if anything looks amiss. Without seeing the query, it's hard to say what is causing the error ... It's likely a problem with one of the values that you are attempting to insert (not escaping a single quote or something to that effect) ...
0

You have a backtick:

IncPXConsid,CarImage`) VALUES

Is this deliberate? It could cause that error because you don't have one at the start of the brackets.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.