• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Value Insertion error in MySQl table

 
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have following table structure


Create table table1(sno int,first_name char,last_name char,age int,salary float,dob date,join_date date,sex char,image longblob,in_time datetime,out_time datetime);




and when i run this query the table is created in my database

but when i try to insert value using this query


INSERT INTO table1 VALUES(1,"Kishor","joshi",23,10000.00,'1991-01-01','2014-06-24',"M",'hshshshhhshsbsbbsbs','2014-07-28 10:00:00'
'2014-07-28 19:00:00');




it shows following log


1 queries executed, 0 success, 1 errors, 0 warnings

Query: insert into table1 values(1,"Kishor","joshi",23,10000.00,'1991-01-01','2014-06-24',"M",'hshshshhhshsbsbbsbs','2014-07-28 10:00:0...

Error Code: 1136
Column count doesn't match value count at row 1

Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0 sec




can someone help me where I am going wrong?


Thanks
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Missing comma before the last value!

Also why is your first name and last name columns "char"? This default to char(1)? Shouldn't you use varchar(###)?
reply
    Bookmark Topic Watch Topic
  • New Topic