I have a section of code that takes a form, with numerous drop down boxes, and runs the results through a mysql database for rows that have the exact wording in them. So say in the drop down box you have three options, No Preference, Fun, Not Fun.
Currently my code only returns results that equal Fun or equal Not Fun. I want to change it so that the code returns rows that contain the word Fun or the words not fun. Here is mysql statement for it:
$strQuery = "select * database " . (trim($strAddQuery) != ""?" where 1=1 ":"") . $strAddQuery . " order by Name";
I know I have to change something in this section of code:
" . (trim($strAddQuery) != ""?" where 1=1 ":"") . $strAddQuery . "
I'm just sort of at a wall and having a hard time figuring it out. This is one of the more complicated things I've done in php (newbie obviously).
$strAddQuery is:
$strAddQuery = $arrQueryParts['a'] . $arrQueryParts['b'] . $arrQueryParts['c']. $arrQueryParts['d']. $arrQueryParts['e'];
Any help is greatly apreciated.