I'm trying to import data into a MySQL database using Java and I'm getting this error:
insert into employee(emp_id, name, dob, email, phone_no, account_number, wage_type, wage_rate, admin_id)values('20002','A B',STR_TO_DATE('20/03/10','%d/%m/%y'),'CGUltimateno1@gmail.com','02194024245','934546','Monthly',''2000,20002')'
SQL State: 42000
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2000,20002')'' at line 1
Here's the inserting code:
query = "insert into employee(emp_id, name, dob, email, phone_no, account_number, wage_type, wage_rate, admin_id)" +
"values('" + emp.getEmp_id() + "','" + emp.getName() + "','" + "STR_TO_DATE('" + emp.getDob() + "','%d/%m/%y')" + "','" + emp.getEmail() + "','" + emp.getPhone_no() + "','" + emp.getAccount_number() + "','" + emp.getWage_type() + "','" + emp.getWage_rate() + "',''" + emp.getAdmin_id() + "')'";
I tried to play around removing the extra ' and " but no luck yet I'm sure the issue is in it