Why is my LIKE Search not working?
Posted: Mon Oct 27, 2003 9:53 am
Hey there, basically i've got several IF statements to add a WHERE or AND clause along with title = '$keyword' as below:
$sql .= " WHERE title LIKE '$keyword'";
echo "test4";
Test4 IS echoed out so i know the script isn't dying on me. Test echoes are also printed before and after the while loop that fetches the results, the only one which isn't echoed out is the one within the While loop that pulls out search results.
At current my keyword im trying to use is test which is searched for in the title field.
the following are in the titles column of the mySQL Database
Test Title
Test Job Title22
This is a testMod
TestMod
Yet none of them show up at all. Am I doing the wrong sort of query here? I just want a similarity style search not an exact one i thought LIKE would pull all those out as they have test in them?
$sql .= " WHERE title LIKE '$keyword'";
echo "test4";
Test4 IS echoed out so i know the script isn't dying on me. Test echoes are also printed before and after the while loop that fetches the results, the only one which isn't echoed out is the one within the While loop that pulls out search results.
At current my keyword im trying to use is test which is searched for in the title field.
the following are in the titles column of the mySQL Database
Test Title
Test Job Title22
This is a testMod
TestMod
Yet none of them show up at all. Am I doing the wrong sort of query here? I just want a similarity style search not an exact one i thought LIKE would pull all those out as they have test in them?