Sep 04
I saw this method used in an old c cook book. Can’t remeber what it’s called, cascading switch anyone??
switch($section)
{
case 'year':
if(empty($select))
$select = ' * ';
if(!empty($year))
$where .= " AND `Year Range` LIKE '%$year%' ";
case 'submodel':
if(empty($select))
$select = ' TRIM(`Year Range`)';
if(!empty($submodel))
$where .= " AND `Model ID` LIKE '%$submodel%' ";
case 'engine':
if(empty($select))
$select = ' TRIM(`Model ID`) ';
if(!empty($engine))
$where .= " AND `Engine Size` LIKE '%$engine%' ";
case 'model':
if(empty($select))
$select = ' TRIM(`Engine Size`) ';
if(!empty($model))
$where .= " AND `Model Name` LIKE '%$model%' ";
case 'make':
if(empty($select))
$select = ' TRIM(`Model Name`) ';
if(!empty($make))
$where .= " AND `Make` LIKE '%$make%' ";
}
January 18th, 2010 at 5:30 pm
thank you for article about SQL statment, it is really great example, especially i liked that you showed us everything all your steps, well done guys
August 25th, 2011 at 12:56 am
Slam dunkin like Shaquille O’Neal, if he wrote infoartmive articles.