I've setup a search for products (stock video clips) by either title, keywords or colors. It works great for terms like "blue", "flag" or "christmas" and returns all the results properly.
However, when I search terms like "california" or "texas" (I have state flags in products) it returns 0 results. Funny thing is that I have the state names in both titles (capitalized) and keywords (uncapitalized). I also have a Mexico flag and it will show up when I search "mexico". I'm stumped.
$q = preg_replace('#[^a-z 0-9]#i', '', $_POST['q']);
$sqlCommand = "SELECT * FROM products WHERE title LIKE '%$q%' OR keywords LIKE '%$q%' OR colors LIKE '%$q%'";
I know it's something small I'm missing, but can't seem to figure it out. Any ideas would be appreciated.
Thank you.