Jump to content


Photo

help!! please mysql...


  • Please log in to reply
5 replies to this topic

#1 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 21 September 2006 - 08:40 AM

i have this :

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'
);

looks fine to me but when i ran it i got this error :

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


#2 neugi

neugi
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 21 September 2006 - 09:45 AM

check if the amount of the y & n are correct, seems there is one more or less in your query.

best

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 21 September 2006 - 01:26 PM

Explicitly specify the column list, and you'll see that they don't match.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 21 September 2006 - 07:32 PM

thx guys , but can you be more precise i am new at this ...
anyone please help

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 22 September 2006 - 09:02 AM

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:
INSERT INTO user (col1, col2, col3, .. etc .. ) Values ('localhost', 'toto', .. etc ..)
Obvioulsy you'll want to change where it says colx - x being a number - to the actuall column name you have in your database.

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 September 2006 - 10:05 AM

Post the SHOW CREATE TABLE output so that I can see how many columns you're supposed to have.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users