Hi there,
Having a lot of trouble with this and PHP isn't my strongest area!
When I search my database it only returns specific sentences like "problems with my internet"
When I search something like "internet problems" I'd like for it to show the same result as above but right now it returns nothing.
How would I go about putting a split string in there?
so I can have my keywords like "internet, problems, with, my," etc.
Thanks for your helpPHP Code:public function getAll ($keywords = NULL)
{
if ($neskeywords == NULL) {
$sql = 'SELECT * FROM nes';
} else {
$sql = 'SELECT * FROM nes WHERE keywords LIKE \'%' . mysql_escape_string($keywords) . '%\'';
}
$stmt = $this->_pdo->query($sql);
$obj = $stmt->fetchALL(PDO::FETCH_CLASS, 'SearchClass');
foreach ($obj as $item) {
$item->id = (int) $item->id;
$ret[] = $item;
}
return $ret;
}


Reply With Quote



Bookmarks