Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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