I created a simple mysql query to run when an user uploads a file. The query is meant to created a new row in the table dress and attach the name of the file to a column titled file_name. However, phpmyadmin tells me that when I run the query in the SQL section I am unable to do so because it gives me this error.
#1054 - Unknown column 'name' in 'field list'
Here is my query code. I suspect it is an syntax error.
INSERT INTO `dress` (file_name) VALUES (name)
Also, here is my info on my database
dress CREATE TABLE `dress` (
`primary_id` int(11) NOT NULL AUTO_INCREMENT,
`file_name` varchar(50) NOT NULL,
`match_1` varchar(100) NOT NULL,
PRIMARY KEY (`primary_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
If you’re trying to insert the value ‘name’, you should put it in quotes – like this: