• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql- auto increment

 
shaz akhtar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im currently having some probs with an auto incrementing table in mysql. my sql scheme for the table is as follows:

create table 'products'(
idnumber int(11) not null auto_increment,
title varchar(255)):

when i try inserting something..such as

insert into products values ('Shrek');

i get an Error Message saying:

'column count doesnt match values count at row 1'

what does this mean?? any suggestions how i may overcome this problemo?

thanks in advance

shahnaz
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm,

insert into products (title) values ('Shrek');

?
 
shaz akhtar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you! it worked.
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alternately you can do "insert values ( 0, title);"
Just because the column is auto-increment you still have to put in a value (which gets ignored).

Or as the previous poster put it you can specifiy the column that you are putting the value in.

-tad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic