• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Value Insertion error in MySQl table

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • 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
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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(###)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic