Jump to content

Archived

This topic is now archived and is closed to further replies.

the apprentice webmaster

help!! please mysql...

Recommended Posts

i have this :

[b]INSERT INTO user
VALUES (

'localhost', 'toto', Password( 'password' ) , 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n'
);[/b]
looks fine to me but when i ran it i got this error :

[b]Error
SQL query:

INSERT INTO user
VALUES (

'localhost', 'toto', Password( 'password' ) , 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n'
);



MySQL said: 

#1136 - Column count doesn't match value count at row 1 [/b]

Share this post


Link to post
Share on other sites
check if the amount of the y & n are correct, seems there is one more or less in your query.

best

Share this post


Link to post
Share on other sites
Explicitly specify the column list, and you'll see that they don't match.

Share this post


Link to post
Share on other sites
Basically check that you have 31 columns within your user table. And the values in your query match up to those columns

What I think fenway meant was to lists you columns in your query: eg:
[code]INSERT INTO user (col1, col2, col3, .. etc .. ) Values ('localhost', 'toto', .. etc ..)[/code]
Obvioulsy you'll want to change where it says colx - x being a number - to the actuall column name you have in your database.

Share this post


Link to post
Share on other sites
Post the SHOW CREATE TABLE output so that I can see how many columns you're supposed to have.

Share this post


Link to post
Share on other sites

×

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.