Ronaldo7 Ronaldo7 - 6 months ago 18
MySQL Question

error in SQL query, can't figure out the syntax error

I am new to mysql db programming, i am not able to figure out what is the error in the mysql insert statement i am executing. MySql Query browser is giving error: error in your SQL syntax.

Structure of my database table:

Table Structure

Command:

insert into mail_client.inbox ( to , from , subject , date , message , uuid )
values ( "fdfgmail.com" , "fromgmail.com" , "subj" , "2016-06-06" , "hello" ,
"0757c2666e934e2eb303df68bb3c9722" );

Answer

Add backticks to the reserved names fields:

`insert into mail_client.inbox ( `to` , `from` , subject , `date` , message ,   uuid ) values ( "fdfgmail.com" , "fromgmail.com" , "subj" , "2016-06-06" , "hello" , "0757c2666e934e2eb303df68bb3c9722" );`