Closed Thread
Results 1 to 5 of 5

Thread: MySQL Column count does not match value count at row 1

  1. #1
    dink is offline Newbie
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Unhappy MySQL Column count does not match value count at row 1

    Hello everyone!
    I am new to mysql and php. I do have some knowledge of C++, Java, and ASP.
    This is the deal:
    I bought the oscommerce for professionals to help with a website I need to create. I downloaded and installed the MySql version 5.01. Installations was successful.

    command line prompt per book directions.


    mysql> use mysql
    database changed

    mysql> insert into users values(
    --> 'localhost',
    -->'username',
    -->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');

    RETURNS THIS:
    ERROR 1136 (21S01): Column count doesn't match value count at row 1
    mysql>


    I have done some exploring and found out that this means there are more values listed than there are columns in the table.

    My question is how do I find out how many columns there are in the table from the command line? This is suppose to an easy exercise just to make sure it works. haha I have been at this for almost 16 hours. I have not even d/l php yet.
    Any help would be greatly appreciated!
    Thanks in advance,
    dink

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: MySQL Column count does not match value count at row 1

    run the command

    Code:
    describe users
    for a column specification for table users

  4. #3
    dink is offline Newbie
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Cool Re: MySQL Column count does not match value count at row 1

    Thanks orjan!

    I could not have done this with out your help. The textbook leaves out a lot of vital information for a newbie.
    I finally got it to work by inserting field names and then the values for the fields that did not have default values.
    INSERT INTO user
    (Host,User,Password,ssl_cipher,x509_issuer,x509_su bject) VALUES('localhost','myuser','mypassword','null','n ull','null');

    There is no way I could have found this information on my own. It only took me 30 minutes to figure out the code you posted needed a semicolon to work. haha

    Again thanks and I really appreciate your help.
    Who knows maybe some day I can help some one.
    dink

  5. #4
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: MySQL Column count does not match value count at row 1

    +rep, orjan.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  6. #5
    sooshyboy is offline Newbie
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Re: MySQL Column count does not match value count at row 1

    Hey, as you can see I'm new here and not sure if anyone will pick up this thread but i have exactly the same problem with exactly the same book! ive tried what orjan said but to no avail... im sure its going to be something simple... but im literally pulling my hair out! Please Help! heres a quick summary of where im at...

    first problem... (Same as original post)

    command line prompt per book directions.


    mysql> use mysql
    database changed

    mysql> insert into users values(
    --> 'localhost',
    -->'username',
    -->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');

    RETURNS THIS:
    ERROR 1136 (21S01): Column count doesn't match value count at row 1
    mysql>



    SO I TRIED... The command

    describe users;

    and just get this...

    Table 'mysql.users' doesn't exist


    ARRGGH!

    Please Help!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to fix MySQL Count Rows?
    By Hunter100 in forum Database & Database Programming
    Replies: 3
    Last Post: 10-20-2011, 02:46 PM
  2. Column count doesn't match value count at row 1
    By msebar in forum PHP Development
    Replies: 2
    Last Post: 12-29-2009, 07:42 AM
  3. Column count doesn't match value count at row 1
    By shiyam198 in forum PHP Development
    Replies: 7
    Last Post: 09-07-2008, 12:13 PM
  4. When you count...
    By Jordan in forum The Lounge
    Replies: 39
    Last Post: 08-19-2008, 10:56 AM
  5. Getting Row Count
    By Lop in forum Managed C++
    Replies: 2
    Last Post: 01-10-2007, 06:17 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts