EllisLab text mark
Advanced Search
     
Scaffolding and Error 1064
Posted: 20 October 2007 08:41 PM   [ Ignore ]
Joined: 2007-03-01
13 posts

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:

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!

 Signature 

Life’s too short.
http://fleethecube.com

 
Posted: 20 October 2007 09:01 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-20
82 posts

sanitize your data. http://in.php.net/add_slashes

 Signature 

PHP Rocks!

 
Posted: 21 October 2007 06:05 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-03-01
13 posts

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.

 Signature 

Life’s too short.
http://fleethecube.com

 
Posted: 21 October 2007 07:04 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-27
198 posts

I know the answer… cool smile
I had the once exactly the same problem and the solution is sooo simple!!!

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