if else question

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

By Rohwer - May 2, 2012 - edited: May 2, 2012

I have a search results page that is pulling in variable family via query string.
ie. ?family=Cruiser

I am making a page that I want to be able to show results from multiple family types.
ie. Cruiser, Dirtbike, Sportbike etc (OR Statements)

Below is the code I have been working with. What am I missing?


$motorcycles=@$_GET['family'];

if($motorcycles=="motorcycle")

list($newvehiclesRecords, $newvehiclesMetaData) = getRecords(array(
'tableName' => 'newvehicles',
'where' => 'active = \'1\' and newused = \'Used\' AND (family = \'Cruiser\' or family = \'Dirtbike\' or family = \'Sportbike\' or family = \'Touring\' or family = \'Trikes\')' ,
'perPage' => $perPage,
'orderBy' => $order,
));

else
list($newvehiclesRecords, $newvehiclesMetaData) = getRecords(array(
'tableName' => 'newvehicles',
'where' => 'active = \'1\' and newused = \'Used\'',
'perPage' => $perPage,
'orderBy' => $order,
));


motorcycles is the variable i am pulling in to set off the if statement.

Thank you community/admins in advance!!

Re: [Jason] if else question

By Rohwer - May 2, 2012 - edited: May 2, 2012

You sir.... rock.

Just had to remove the 'allowSearch' => false, in the else portion.

because this page only has that one exception.

Much appreciated!