xcandiottix Posted August 1, 2010 Share Posted August 1, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/209476-error-on-line-but-cant-figure-out-why/ Share on other sites More sharing options...
dreamwest Posted August 2, 2010 Share Posted August 2, 2010 It just means your csv dosnt have a value for that field your inserting. Itll be one of your blank fields thats causing the problem. You should "As defined" your field default and give it some default value. Quote Link to comment https://forums.phpfreaks.com/topic/209476-error-on-line-but-cant-figure-out-why/#findComment-1094051 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.