I used your method and try to implement in my function.. here it is:
$explodemodel = explode(" ",$model);
$models = "";
$i=0;
while ($i < count($explodemodel)) {
if ($i=0){
$model1 = "model LIKE" ." '%$explodemodel[0]%'";
}
else {
$models .= "OR model LIKE" ." '%$explodemodel[$i]%'";
}
$i++;
}
echo"$model1,$models";
basically, this is for the SELECT WHERE statement. I exploded the model value and do search of model LIKE 'exploded[0,1,2,3..]' one by one..
this function gave me this error:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 22 bytes
any idea how to fix it? Thanks.
btw, your original function works