Jump to content

[SOLVED] Invalid Field Count


camdenite

Recommended Posts

Hi all,

I tried adding a unique id to a table that already existed but I keep getting "Invalid Field Count" when I upload the csv.

 

Please tell me what I am missing. I added blog_id and the id in the insert.

 

Cheers,

Colin.

 

CREATE TABLE `blogb` (

`blog_id` INT unsigned NOT NULL auto_increment,

  `date1` varchar(8) NOT NULL,

  `date2` varchar(8) NOT NULL,

  `heading` varchar(60) NOT NULL,

  `category_id` varchar(4) NOT NULL,

  `first_para` text NOT NULL,

  `entry` text NOT NULL,

  `more` text NOT NULL,

  `image1` varchar(100) NOT NULL,

  `image2` varchar(100) NOT NULL,

  `image3` varchar(100) NOT NULL,

  `image4` varchar(100) NOT NULL,

  `publish` varchar(8) NOT NULL,

  `pub2` enum('yes','no') NOT NULL default 'no',

  UNIQUE KEY (email),

  KEY `date1` (`date1`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8;

 

And here is the csv:

 

"1";"20080724";"24.07.08";"This is a test";;"Testing one two three ...";"<strong>polly wants a cracker</strong> ";;;;;;;"no"

Link to comment
https://forums.phpfreaks.com/topic/143620-solved-invalid-field-count/
Share on other sites

Hi Zhadus, Thanks for that. I have tried this:

 

"";"20080724";"24.07.08";"This is a test";;"Testing one two three ...";"<strong>polly wants a cracker</strong> ";;;;;;;"no"

"";"20080905";"05.09.08";"another";"02";"connecting with this ole shaboodle is proving problematic";"<p>well here i am just wondering what to do!</p>";;"ok";"";;;;"no"

 

and this:

 

;"20080724";"24.07.08";"This is a test";;"Testing one two three ...";"<strong>polly wants a cracker</strong> ";;;;;;;"no"

;"20080905";"05.09.08";"another";"02";"connecting with this ole shaboodle is proving problematic";"<p>well here i am just wondering what to do!</p>";;"ok";"";;;;"no"

 

and this:

 

"20080724";"24.07.08";"This is a test";;"Testing one two three ...";"<strong>polly wants a cracker</strong> ";;;;;;;"no"

"20080905";"05.09.08";"another";"02";"connecting with this ole shaboodle is proving problematic";"<p>well here i am just wondering what to do!</p>";;"ok";"";;;;"no"

 

I'm not sure what else to do.

 

Thankyou for your help.

 

 

In your table design, you are setting your field properties to "NOT NULL" which means you cannot insert a NULL into it.

 

Every line you have ;;; in a row, those are NULL entries.

 

So either change your fields to allow NULLS or put values in every field.

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.