Help with where clause syntax
3 posts by 3 authors in: Forums > CMS Builder
Last Post: May 18, 2009 (RSS)
By avrom - May 15, 2009 - edited: May 15, 2009
Hi Ross, Hi Dave,
Just trying to figure out how to add the $listing variable into the "where" statement. Can't quite figure out the correct syntax for that.
Much thanx !! :))
<?php
$listing = 'Accommodation';
list($business_profileRecords, $business_profileMetaData) = getRecords(array(
'tableName' => 'business_profile',
'where' => 'category = $listing',
));
?>
Just trying to figure out how to add the $listing variable into the "where" statement. Can't quite figure out the correct syntax for that.
Much thanx !! :))
<?php
$listing = 'Accommodation';
list($business_profileRecords, $business_profileMetaData) = getRecords(array(
'tableName' => 'business_profile',
'where' => 'category = $listing',
));
?>
Re: [virgodesign] Help with where clause syntax
By Djulia - May 15, 2009 - edited: May 15, 2009
Hi Avrom,
You can perhaps use :
'Where' => " 'category = ' " . $listing . " ' ",
That must function.
Djulia
You can perhaps use :
'Where' => " 'category = ' " . $listing . " ' ",
That must function.
Djulia
Re: [virgodesign] Help with where clause syntax
By ross - May 18, 2009
Hi Avrom
Thanks for posting!
What is the $listing variable that you are using. Is it a value set by something in the query string? Or something else on the page.
What is it that you are trying to do with the variable?
Let me know and we'll go from there. Thanks!
Thanks for posting!
What is the $listing variable that you are using. Is it a value set by something in the query string? Or something else on the page.
What is it that you are trying to do with the variable?
Let me know and we'll go from there. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/