Voy mejorando???
Código PHP:
public function getSearch($search,$filterData = null){
$products=htmlspecialchars($_REQUEST["search"]);
if(isset($products) && ($products != "") && ($products<>'')){
$sentence = "SELECT * WHERE cosa ='".$productos."'";
$sentence = $sentence." ORDER BY precio ".$orden."";
$sentence = $sentence." LIMIT 100";
$consulta= $this->getConect()->prepare($sentence);
$consulta->execute();
$existData = false;
if(!$consulta){
$sentences = "SELECT * WHERE cosa LIKE'".$productos%."'";
$sentences = $sentences." ORDER BY precio ".$orden."";
$sentences = $sentences." LIMIT 100";
$consulta= $this->getConect()->prepare($sentences);
$consulta->execute();
$existData = false;
}
}