Multiple WHERE clause filters
3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 8, 2012 (RSS)
By markr - October 8, 2012
Can multiple filters be used, e.g. with AND, cuz what I've tried is not working?
Re: [markr] Multiple WHERE clause filters
Hi,
It is possible to use an AND statement in the getRecords fuction and mysql_select. Where are you using the statement? If it's in a get_records function you should be able to do something like this:
If your using the mysql_select function the easiest way to filter multiple fields like this:
Thanks!
It is possible to use an AND statement in the getRecords fuction and mysql_select. Where are you using the statement? If it's in a get_records function you should be able to do something like this:
list($test, $testMeta) = getRecords(array(
'tableName' => 'tableNameGoesHere',
'where' => "field1 ='1' AND field2 = '1'"
));
If your using the mysql_select function the easiest way to filter multiple fields like this:
$test = mysql_select('tableName', array('field1' => '1','field2' => '1'));
Thanks!
Greg Thomas
PHP Programmer - interactivetools.com
PHP Programmer - interactivetools.com
Re: [greg] Multiple WHERE clause filters
By markr - October 8, 2012
I forgot to mention that I was using the getRecords fuction, and it works great. Thx