Jump to content

Tab delimited issue - please help!


Mr Chris

Recommended Posts

Hi Guys,

Trying to load a tab-delimited file to a MySql database, but getting the error message:

[b] INSERT INTO test (first_name, last_name, department, dob) VALUES ('')Column count doesn't match value count at row 1[/b]

But I have the same amount of columns in my table as I do in my tab-delimited file being uploaded. I've also echoed out the query, but still don't understand. Can anyone please advise by looking at the code below – especially my INSERT into statement?

Many Thanks

Chris

oh and here's the code

(Edit - won't let me post the code for some reason so a link can be found) [a href=\"http://www.thisisslough.com/code.txt\" target=\"_blank\"]HERE[/a]
Link to comment
Share on other sites

certailny tour query is wrong at this point --> INSERT INTO test (first_name, last_name, department, dob) VALUES ('')

The query should have the values entered or left blank atleast.
The right query would be

INSERT INTO test (first_name, last_name, department, dob) VALUES ('','','','');

Just note that when you explicitly mention the parameters of the insert statement, then you should mention the corresponding values also.

Please refer to th mysql manual & have a look at the insert SYNTAX.
Link to comment
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.