Jump to content

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.

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.