My apologies, I posted the wrong code. The code above is the feeble attempt I made to secure it that didn't work. Here is my original code with no attempt made:
if($searchby == "Car") {$var1 = "CarA";} //where CarA is column name in table
if($searchby == "Van") {$var1 = "VanA";} //where VanA is column name in table
if($var2){
$var2temp = "$var2";
}
if($var2temp){
$var2 = "$var2temp%";
}
if(!($var1)){
$var1 = "VanA";
}
$result = mysql_query("SELECT * FROM vehicles WHERE vehicles.$var1 LIKE '$var2' ORDER BY Type ASC",$dbase);