I'm trying to insert data in to my 'command' table where 'trigger' and 'desc' are not null varchar(255) and there is an int 'id' primary key set to auto increment.
MySQL workbench is throwing an error for the open parentheses after 'command':
"(" is not valid at this position for this server version, expecting: VALUE, SELECT, SET, VALUES, WITH
For any insert query I attempt e.g:
INSERT INTO command('trigger','desc') VALUES("value","value");
This is likely a really simple error on my part but I can't seem to spot what is wrong here, any ideas?
Desc
& trigger
are reserved words, so they can't be used as column names unless you use backticks. See this post for further explanation.
Once this is resolved, the SQL query is also incorrectly formatted as the column names should not be surrounded by quotes.
Use the following as a guide:
INSERT INTO command (`trigger`, `desc`) VALUES ('value', 'value');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With