Jump to content

Error on line .. but can't figure out why


xcandiottix

Recommended Posts

Godaddy linux server

Server version: 5.0.91

MySQL charset: UTF-8 Unicode (utf8)

 

Table geo_city

 

Fields:

locId (Key) int, no collation, unsigned, not null

country char, utf8_general..., not null

region varchar, utf8_general..., not null

city varchar, utf8_general..., not null

postalCode int, unsigned, not null

latitude int, unsigned, not null

longitude int, unsigned, not null

metroCode int, unsigned, not null

areaCode int, unsigned, not null

 

I'm using the Import tab in myphp to upload a CSV file.

 

char set: utf8

uncompressed

X allow interrupt of import

Number of records to skip 0

Format of imported file: CSV

[] replace table data

[] ignore duplicate rows

fields terminated by ,

fields enclosed by '

fields escaped by \

lines terminated by auto

column names: i type in the exact same fields as above.

 

CSV imports 16 lines of 65535, stops at 17th line (locId 16) does not import:

 

locId country region city postalCode latitude longitude metroCode areaCode

1 O1 0 0

2 AP 35 105

3 EU 47 8

4 AD 42.5 1.5

5 AE 24 54

6 AF 33 65

7 AG 17.05 -61.8

8 AI 18.25 -63.1667

9 AL 41 20

10 AM 40 45

11 AN 12.25 -68.75

12 AO -12.5 18.5

13 AQ -90 0

14 AR -34 -64

15 AS -14.3333 -170

16 AT 47.3333 13.3333

 

Error: Invalid field count in CSV input on line 17.

SQL QUERY

REPLACE INTO `geo_city` (`locId`, `country`, `region`, `city`, `postalCode`, `latitude`, `longitude`, `metroCode`, `areaCode`) VALUES ('locId', 'country', 'region', 'city', 'postalCode', 'latitude', 'longitude', 'metroCode', 'areaCode')# Affected rows: 1

REPLACE INTO `geo_city` (`locId`, `country`, `region`, `city`, `postalCode`, `latitude`, `longitude`, `metroCode`, `areaCode`) VALUES ('1', 'O1', '', '', '', '0', '0', '', '')# Affected rows: 1

REPLACE INTO `geo_city` (`locId`, `country`, `region`, `city`, `postalCode`, `latitude`, `longitude`, `metroCode`, `areaCode`) VALUES ('2', 'AP', '', '', '', '35', '105', '', '')# Affected rows: 1

REPLACE INTO `geo_city` (`locId`, `country`, `region`, `city`, `postalCode`, `latitude`, `longitude`, `metroCode`, `areaCode`) VALUES ('3', 'EU', '', '', '', '47', '8', '', '')# Affected rows: 1

REPLACE INTO `geo_city` (`locId`, `country`, `region`, `city`, `postalCode`, `latitude`, `longitude`, `metroCode`, `areaCode`) VAL[...]

 

I have no idea why it stops for line 17 =/ First time importing into MySql.

 

Link to comment
https://forums.phpfreaks.com/topic/209476-error-on-line-but-cant-figure-out-why/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.