I'm basically doing a submit form, and for some extremely irritating reason, it won't work! I'm inserting values into my database which looks like this:
id - int(11) primary key auto name - varchar(100) s_info - varchar(200) info - text type - varchar(200) by - varchar(200) published - varchar(50) codelink - varchar(500)
This is the error I get: Error: 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 'by, category) VALUES ('no', 'App', 'Schart Clock', 'A nice clock to add to your ' at line 1
This is extremely frustrating! Any suggestions? Please help.
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 ''name', 's_info', 'info', 'category', 'type', 'by', 'published', 'codelink') VAL' at line 2
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 ''apps' ('name', 's_info', 'info', 'category', 'type', 'by', 'published', 'codeli' at line 1
:/... Really thought that one would help. I see the logic in it
That is a very good idea! Whether or not it work's I'm going to close this thread and try to figure it out. Thank's for your great support, you have surely helped me a lot recently! Seriously, is there any website of yours I can promote or anything?
Notice that there was no concatenation in the first one. You need to break out of your "string" to insert the vars. The first part should look like Karls basically.
...('" . $name . "', '" . $info . "' .....
You could, because you are using " " (double quotation marks) wrap each var in { } so...
This is the error I get:
Error: 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 'by, category) VALUES ('no', 'App', 'Schart Clock', 'A nice clock to add to your ' at line 1
This is extremely frustrating! Any suggestions? Please help.
Thank's :)
The error message suggests the code you are running is slightly different to whats posted
:/... Really thought that one would help. I see the logic in it
Try it with one value at a time to narrow it down
It could be an issue with one of the values you are inserting
Keep at it and you'll get there :)
btw take a look into PDO
http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/
Have a few sites in the works myself but don't wanna promote them yet :)
and what Karl tried
Notice that there was no concatenation in the first one. You need to break out of your "string" to insert the vars. The first part should look like Karls basically.
You could, because you are using " " (double quotation marks) wrap each var in { } so...
Other than that - I can't really see a problem with your actual SQL itself...