Variable in WHERE clause

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 15, 2012   (RSS)

Re: [terryally] Variable in WHERE clause

By Steve99 - May 14, 2012

Hi Terry,
It looks like you need to wrap the variable so it doesn't see it as comparing a column.

Try this:
$page_name = basename($_SERVER['PHP_SELF']);

list($page_submenuRecords, $page_submenuMetaData) = getRecords(array(
'tableName' => 'page_submenu',
'where' => 'which_page = "'.$page_name.'"',
));


Hope this helps!

Re: [steve99] Variable in WHERE clause

By terryally - May 15, 2012

Hi Steve,

Should've tried that before I posted here.

It works perfectly!

Thanks very much for your help.

Best regards
Terry