17452 Posts in 4473 Topics by 1971 members
|Go to End|
30 May 2007 at 11:07am
I have made a db field caled `Index`:
static $db = array(
'Index' => 'Int',
Then rebuild DB makes an error:
FATAL ERROR: DATABASE ERROR: Couldn't run query: INSERT INTO `XEArticlePage_Live` (ID,Date, Index, ArticleFileID) SELECT ID,Date, Index, ArticleFileID FROM `XEArticlePage` | 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 'Index, ArticleFileID) SELECT ID,Date, Index, ArticleFileID FROM `XEArticl' at line 1
At line 186 in /var/www/xebidy/sapphire/core/model/Database.php
The SQL Query should look like this
INSERT INTO `XEArticlePage_Live` (`ID`,`Date`, `Index`, `ArticleFileID`) SELECT `ID`,`Date`, `Index`, `ArticleFileID` FROM `XEArticlePage`
I guess this field can make even more problems, so I am going to rename it.
30 May 2007 at 9:30pm
"Index" is a reserved SQL-name, and should be properly quoted. As you said, it's best to avoid those naming-problems by choosing something less common
I've added a bug for it in our issue-tracker.
|Go to Top|