Error in your SQL syntax

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 20, 2010   (RSS)

Re: [aquaman] Error in your SQL syntax

By Dave - January 15, 2010

It looks good to me. Click on: Admin > Section Editors and make sure the 'pages' section has been created. Next, check you can add and modify records through the CMS for that section.

If you're still having problems after that, try this debugging option and let us know what it says:

'debugSql' => true,

Hope that helps!
Dave Edis - Senior Developer

interactivetools.com

Re: [Dave] Error in your SQL syntax

By theclicklab - January 15, 2010

Got it sorted :)

I changed the name of the field "show" and it now works. I guess that reserved for something.

Cheers,
Jan

Re: [Dave] Error in your SQL syntax

By Dave - January 20, 2010

I was just going to post a follow up on this one that 'show' is in fact a reserved mysql word:
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

And a trick for dealing with those is either renaming the field -or- surrounding it with `backticks` (beside the 1 on most keyboards) like this:

'where' => 'active ="1"' . ' AND `show` ="1" ',

Backticks are of telling MySQL that you mean a table or fieldname and not anything else.

Most of the time it's just easier to rename the field, though. :)
Dave Edis - Senior Developer

interactivetools.com