These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

php mysql help

Author
TakerOfLife
Cloaked Goof
Goonswarm Federation
#1 - 2016-10-23 19:51:33 UTC
i have code to get market dump and trying to get it into my sql

code

and i get a error

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 'Entered, RangeR, Station, Type)VALUES('', '2016-09-06T11:15:05', '50000', '365',' at line 1 

go here to see output of code
Ydnari
Estrale Frontiers
#2 - 2016-10-23 22:00:40 UTC
You're missing an underscore between Volume and Entered.

--

TakerOfLife
Cloaked Goof
Goonswarm Federation
#3 - 2016-10-24 03:53:34 UTC
Ydnari wrote:
You're missing an underscore between Volume and Entered.

it should not have one BD Name does not have it fix the one that did still not working
Althalus Stenory
Flying Blacksmiths
#4 - 2016-10-24 07:59:12 UTC  |  Edited by: Althalus Stenory
A space is missing here (line 20 from your paste)

$sql = "INSERT INTO Items(Buy, Issued, Price, Duration, ID, Minvolume, Volume Entered, RangeR, Station, Type)VALUES";


it should be :
$sql = "INSERT INTO Items(Buy, Issued, Price, Duration, ID, Minvolume, Volume Entered, RangeR, Station, Type) VALUES ";

(note the space BEFORE and AFTER "VALUES" )

Same thing line 53 and 69.

Also i'm wondering if you shouldn't "protect" your table column by adding `` around special column (those who are mysql keywords, like "type" for example, and those with spaces) (the easiest way is to escape everything, so you don't need to ask yourself "do I need to escape table column name ?".

So :
$sql = "INSERT INTO Items(Buy, Issued, Price, Duration, ID, Minvolume, `Volume Entered`, RangeR, Station, `Type`) VALUES ";

EsiPy - Python 2.7 / 3.3+ Swagger Client based on pyswagger for ESI

Bloemkoolsaus
Deep Core Mining Inc.
Caldari State
#5 - 2016-10-24 12:49:23 UTC
If you have spaces in your table names you have to espace it with back-ticks. See Althalus' last exemple.