[Solar-talk] Model class exception where column name = "key"
Antti Holvikari
anttih at gmail.com
Wed Dec 12 14:50:47 CST 2007
On Dec 12, 2007 6:21 PM, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> On Dec 12, 2007 2:09 PM, Cruz, Darwin wrote:
> > I've run into an issue where if i have a table in the database with a
> > field that is named "key" i'm getting an exception error when i call a
> > fetchAll() to the model.
> >
> > error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have
> > an error in your SQL syntax;
> >
> > I changed to column name from "key" to "mykey" and it works fine. Just
> > wanted to let people know.
>
> Hey,
> This occurs because Solar_Sql won't let you use reserved words from
> the supported adapters. Meaning: all reserved words from all supported
> databases are blacklisted in Solar_Sql_Reserved. Take a look there.
yeah, but that seems to be an error from PDO. Shouldn't Solar_Sql
supposed to throw an error even before sending the query?
--
Antti Holvikari
More information about the Solar-talk
mailing list