Error in your SQL syntax

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

Hi there, having an issue with this code which I am using on another site (different host) without any problem... not sure if it is my code or version of mysql (version: 5.0.22)??

<?php
list($pagesRecords, $pagesMetaData) = getRecords(array(
'tableName' => 'pages',
'where' => 'active ="1"' . ' AND show ="1"',
'loadUploads' => '0',
'allowSearch' => '0',
));
?>


Error:

MySQL Error: 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 'show ="1") ORDER BY dragSortOrder DESC' at line 3

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

Got it sorted :)

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

Cheers,
Jan