Small where clause issue
12 posts by 2 authors in: Forums > CMS Builder
Last Post: April 19, 2010 (RSS)
By Jason - April 19, 2010
Hi,
We're going to need to change our code a bit. Try this code for getting the records:
Now, you may need to change this depending on exactly what you want to return. If you want to get all of the records whose category is ATP AND Australian Open, then you can leave this code as it is. If you want to get the records whose category is ATP OR Australian open, you need to change this one line:
Give that a try and let me know.
We're going to need to change our code a bit. Try this code for getting the records:
<?php
list($catsRecords,$catsMetaData)=getRecords(array(
'tableName'=>'category',
'where'=>"title='ATP' or title='Australian Open'",
'allowSearch'=>0,
));
$count=0;
foreach($catsRecords as $cats){
if($count==0){
$catlist="category LIKE ";
$count++;
}
else
$catlist.=" AND category LIKE ";
$catlist.="'%\t".$cats['num']."\t%'";
}
list($catRecords,$catMetaData)=getRecords(array(
'tableName'=>'fpvideo',
'where'=>$catlist,
'allowSearch'=>0,
));
?>
Now, you may need to change this depending on exactly what you want to return. If you want to get all of the records whose category is ATP AND Australian Open, then you can leave this code as it is. If you want to get the records whose category is ATP OR Australian open, you need to change this one line:
$catlist.=" OR category LIKE ";
Give that a try and let me know.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Small where clause issue
This works perfect, thanks so much Jason. There's one last issue I'm dealing with and after that, I promise not to bug you again for at least a month [sly] I posted that problem here: http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/Excluding_specific_record_P79496/
Thanks!
Kind Regards,
Hans
Thanks!
Kind Regards,
Hans