Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2003, 01:15 PM
Registered User
 
Join Date: Jun 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default INSERT with MySQL

In chapter 11 under Manipulating Data in a Database there is a INSERT command example. I have done all of the required steps to get to the database and everything and I type in what it says but I am getting a:

ERROR 1136: Column count doesn't match value count in row 1

Can anyone tell me why?
 
Old June 5th, 2003, 04:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Hmm..
On my comp works correctly...

...but the Soon is eclipsed by the Moon
 
Old October 6th, 2005, 06:51 AM
Registered User
 
Join Date: Jul 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I appreciate your question was posted more than 2 years ago, so the sethtrain may have already left the station, but if you're referring to the INSERT INTO DVDs2, where values are copied from another database, I had the same problem and solved it by including 'DVDID' as one of the fields in the SELECT. It would appear that this error can be generated when there are fewer columns specified in the destination table than in the source.

Quote:
quote:Originally posted by sethtrain
 In chapter 11 under Manipulating Data in a Database there is a INSERT command example. I have done all of the required steps to get to the database and everything and I type in what it says but I am getting a:

ERROR 1136: Column count doesn't match value count in row 1

Can anyone tell me why?
101boxdevice
 
Old October 6th, 2005, 07:36 AM
Registered User
 
Join Date: Jul 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Further to my last post, I now realise I mis-named the field 'DVID', when it should have been 'DVDName' - so this is one way at least that the error can occur ... ;-(

101boxdevice
 
Old August 1st, 2006, 06:38 AM
Registered User
 
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to PeterJB
Default

I had the same problem but found that it was the tomestamp and date that was added to the db in the command line client, easily fixed by adding tha approtriate info for example:-

mysql> INSERT INTO users VALUES(
     ->NULL,
     ->'Pads',
     ->password('password'),
     ->'Brian Reid',
     ->'Winger',
     ->'[email protected]',
     ->'A top class ball handler.'),
     ->'yyyy-mm-dd',
     ->'yyyymmddhhmmss');

Note the extra date and time tables in the db, either drop the tables or populate them. You might have others tho so check and see first.

you can do that by opening your command line client and typing in your password, then type:-

mysql> SHOW DATABASES;

and you should get something that looks like this:-

 --------------------
| Database |
 --------------------
| Test |
| Sample_db |
 --------------------

Then type:-

mysql> USE sample_db;

Then type:-

mysql> SHOW TABLES;

and you'll get something like this...

 -----------------------
| Tables in sample_db |
 -----------------------
| access_log |
| user |
 -----------------------

then you type...

mysql> DESC user;

and you should get a list of all the field titles which you need to fill when you enter the information into the database through your command line client.

I understand this post is way late but maybe it can help someone else...





Dislexics have more fnu





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert textarea content into MySQL? a5xo3z1 Beginning PHP 14 October 2nd, 2008 01:47 PM
Trying to insert a date into MySQL from asp bleutiger Classic ASP Professional 8 May 5th, 2008 01:42 PM
Cannot INSERT INTO mySQL database anymore! aspiretech PHP Databases 2 December 10th, 2005 01:07 AM
cannot insert into mysql:data LogicalDevloper Pro PHP 1 December 22nd, 2004 09:08 AM
insert null value in MySql? donh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 November 28th, 2003 11:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.