SQL SELECT problem
I have the following query:
"SELECT faq_ID, faq_Q FROM faq WHERE faq_Cat = '$fid' AND (faq_Model = '$model' OR faq_Model LIKE '%$model%') ORDER BY faq_Order"
Now the problem is the "(faq_Model = '$model' OR faq_Model LIKE '%$model%')" section. This is checking a field that has models in the field. So for instance the model is D2 i am searching for, I am only getting returned the rows of data that D2 is in the string of models. But i want all rows that have to do with the D2 model.
So for instance one row, the faq_Model field contains this value "98p D2 F1" this is getting returned by the query, but the row containing just "D2" is not, even though the variable $model contains the value of "D2". Please help.
|