The query :

INSERT INTO tabticket




VALUES('ticket-00782','2016-09-01 010:20:07.634000','2016-09-01 10:30:07.634000','kalyan@kamworks.com','kalyan@kamworks.com',0,'NULL','NULL',NULL,0,'','ខុនរ៉ង Khon Rang- 

040104',' ','NULL',0,'កំពង់អួរ Kampong Uor - 04010410','NULL','SHS100 163','Som Sophat','NULL','0','NULL','NULL','0','NULL',' ',NULL,'no power','NULL','កំពង់ឆ្នាំង Kampong 

Chhnang',' ','NULL','NULL','NULL','NULL','097 5 005 554','បរិបូណ៌ Baribour - 0401','NULL',0,'040000049','SHS 100W -v2.0',' ',' ','2016-09-01','Pending repair visit',' ',' ');

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'high_priority,village,solved_date,shs_id,customer_name,bottow_red_light,consumpt' at line 1


Always use a SQL statement to check your statement, you don't need to post this if you have those tools.

First, high_priority is part of mysql select statement reserved word. If you use it as your column name, you must explicitly use quotation mark to prevent the query engine treat it as part of command.

Second, opening_ticket-DATE are going to give you error, after you fix high_priority with a quote. Again, without a quote, mysql query just treat the "-" mark as arithmetic operator, .e.g. opening_ticket (minus) DATE.

This is a terrible RBMS table structure, it is not normalised and doesn't standardise naming convention.

For example, I will use "priority" as the column name, limit the value to "low,medium,high" or "1,5,10" , this will allow assignment depends on written algorithm.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.