+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Newbie dink is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    2

    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. #2
    Moderator Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan is a glorious beacon of light Orjan's Avatar
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Age
    34
    Posts
    2,617
    Blog Entries
    7

    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

  3. #3
    Newbie dink is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    2

    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

  4. #4
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Java:Tutorial - Tic-Tac-Toe
    By John in forum Java Tutorials
    Replies: 29
    Last Post: 03-12-2010, 11:53 PM
  2. Tutorial: Storing Images in MySQL with PHP
    By Jordan in forum PHP Tutorials
    Replies: 43
    Last Post: 01-16-2010, 10:35 AM
  3. MySQL Resources
    By dirkfirst in forum Database & Database Programming
    Replies: 2
    Last Post: 08-25-2009, 04:46 AM
  4. Column count doesn't match value count at row 1
    By shiyam198 in forum PHP Forum
    Replies: 7
    Last Post: 09-07-2008, 02:13 PM
  5. MySQL Error: #1052 - Column 'id' in field list is ambiguous
    By Crane in forum Database & Database Programming
    Replies: 2
    Last Post: 09-30-2007, 09:16 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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