CodeIgniter Forums
Scaffolding and Error 1064 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Scaffolding and Error 1064 (/thread-3760.html)



Scaffolding and Error 1064 - El Forum - 10-20-2007

[eluser]Unknown[/eluser]
Hello, I'm very new to CI and quite new to MySQL, so I have no idea where this might be coming from. I did a search and found a few similar errors, but nothing that explained how I might fix it.

Basically, I wanted to use scaffolding to insert a few entries into my feeds table. I got this error:

Code:
An Error Was Encountered

Error Number: 1064

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 'desc, feedURI, feedVer, siteURI, lastRetrieved, lastAttempt, errorMsg) VALUES ('' at line 1

INSERT INTO feeds (title, desc, feedURI, feedVer, siteURI, lastRetrieved, lastAttempt, errorMsg) VALUES ('Testing it again', 'Is the problem the name of the table?', 'http://something.xyz', 'rss', '', '', '', '')

An ideas? Thanks for the help!


Scaffolding and Error 1064 - El Forum - 10-20-2007

[eluser]imzyos[/eluser]
sanitize your data. http://in.php.net/add_slashes


Scaffolding and Error 1064 - El Forum - 10-21-2007

[eluser]Unknown[/eluser]
I have to sanitize even when I use scaffolding? Is the sanitizing for PHP or for MySQL? When I made entries through phpmyadmin, I didn't have any trouble.


Scaffolding and Error 1064 - El Forum - 10-21-2007

[eluser]gunter[/eluser]
I know the answer... :coolsmile:
I had the once exactly the same problem and the solution is sooo simple!!!

desc is a reserved word for mysql!!! use another name!