Welcome Guest, Not a member yet? Register   Sign In
Scaffolding and Error 1064
#1

[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!
#2

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

[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.
#4

[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!




Theme © iAndrew 2016 - Forum software by © MyBB