Oke here's my problem. I've got this databse of sentances. I need to search this database of sentances and return any results. Such as, if you search for the word 'php' it would return a value of all the sentances that had that word in it. Here's the script I came up with:
$query = "SELECT name FROM search";
$result = mysql_query($query);
if (preg_match ("/$term/i", "$result")) {
print "A match was found.";
} else {
print "A match was not found.";
}
I've got this test sentance in the db:
PHP rules.
I search for 'PHP'. It says "a match was not found". What am I doing wrong?





Bookmarks