Hey guys, i am trying to implement this piece of code around a full text search but i havent worked with them before. I want that the user doesnt have to enter all of the keyword entered, so they can type half the keyword and it will still display the result. This is what i have so far!
public function fetchAllByDescription($description){
$db = Zend_Db_Table::getDefaultAdapter();
$statement_front = "SELECT * FROM p2_parts p INNER JOIN p2_parts_category c ON p.partNumber = c.partNumber WHERE";
$sql = $statement_front." p.description LIKE '%{$description}%' OR c.category LIKE '%{$description}%' LIMIT 200";
$select = $db->query($sql);
$results = $select->fetchAll();
if (0 == count($results)) {
return;
}
$products = array();
foreach($results as $r) {
if(isset($r['ID'])){
$products[] = $this->find($r['ID']);
}
}
return $products;
}
Any help would be appreciated. Thanks!