This is a stupid way I have... since very likely the value I have will be within 4 words, I can do the if statement 5 times.. like this:
$explodemodel = explode(" ",$model);
for ($i=0;$i<count($explodemodel);$i++)
{
$expmodels[$i]= $explodemodel[$i];
}
if (count($explodemodel) = 0) {
$models = 'model LIKE ' .'%explodemodel[0]%';
}
elseif (count($explodemodel) = 1) {
$models = 'model LIKE ' .'%explodemodel[0] . 'OR model LIKE' .'%explodemodel[1]%';
}
then SELECT * WHERE $models
isn't this stupid? help me out please!