Reply to Re: [PHP] Error #1136

Your name:

Reply:


Posted by "Richard Lynch" on 08/25/05 11:03

On Wed, August 24, 2005 11:42 am, George B wrote:
> Column count doesn't match value count at row 1
>
> What does that mean? I have an id auto_increment and it breaks
> everytime
> because of that error. This has never happend before...

If you REALLY don't want to specify all the column names (as suggested
by others) you *CAN* use NULL for the auto_increment field value, and
MySQL will do the right thing.

create table example (
example_id int(11) unsigned auto_increment unique not null primary key,
example text
);

INSERT INTO example VALUES (NULL, 'This is an example.');

It's probably better to get in the habit of specifying columns,
though, because eventually you'll have tables where only SOME columns
are known at the time of the initial INSERT, and others will be
UPDATEd later, or not at all, depending on the application.

So you *CAN* do this, but I'm recommending that you don't.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация