Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-06-2008, 07:09 PM
dink dink is offline
Newbie
 
Join Date: Sep 2008
Posts: 2
Rep Power: 0
dink is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-06-2008, 07:25 PM
orjan's Avatar   
orjan orjan is offline
Programming Professional
 
Join Date: Sep 2007
Location: Sunne, Värmland, Sweden
Age: 33
Posts: 328
Last Blog:
Procedural Programming...
Rep Power: 9
orjan has a spectacular aura aboutorjan has a spectacular aura aboutorjan has a spectacular aura about
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-07-2008, 03:54 AM
dink dink is offline
Newbie
 
Join Date: Sep 2008
Posts: 2
Rep Power: 0
dink is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-07-2008, 01:49 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,583
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: MySQL Column count does not match value count at row 1

+rep, orjan.
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Storing Images in MySQL with PHP Jordan PHP Tutorials 13 09-23-2008 07:11 PM
Column count doesn't match value count at row 1 shiyam198 PHP Forum 7 09-07-2008 03:13 PM
Java:Tutorial - Tic-Tac-Toe John Java Tutorials 25 02-27-2008 07:41 PM
MySQL Error: #1052 - Column 'id' in field list is ambiguous Crane Database & Database Programming 2 09-30-2007 10:16 AM
MySQL Resources dirkfirst Database & Database Programming 1 05-25-2006 03:31 AM


All times are GMT -5. The time now is 05:54 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads