Problem polega na tym iż wpisuje jedno słowo to wyszukuje bez problemu, lecz jak już wpisze dwa słowa to już nic nie pokazuje. Mój kod wygląda tak :
function getRecords($params) { $start_from = ($page-1) * $rp; $sql = $sqlRec = $sqlTot = $where = ''; $where .=" WHERE "; $where .=" ( employee_name LIKE '%".$params['searchPhrase']."%' "; $where .=" OR employee_salary LIKE '".$params['searchPhrase']."%' "; $where .=" OR employee_age LIKE '".$params['searchPhrase']."%' "; $where .=" OR employee_magazyn LIKE '".$params['searchPhrase']."%' )"; } } // getting total number records without any search $sql = "SELECT * FROM `employee` "; $sqlTot .= $sql; $sqlRec .= $sql; //concatenate search sql if value exist $sqlTot .= $where; $sqlRec .= $where; } if ($rp!=-1) $sqlRec .= " LIMIT ". $start_from .",".$rp; while( $row = mysqli_fetch_assoc($queryRecords) ) { $data[] = $row; } "rowCount" => 10, "rows" => $data // total data array ); return $json_data; }
Próbowałem już tez :
function getRecords($params) { $start_from = ($page-1) * $rp; $sql = $sqlRec = $sqlTot = $where = ''; $where .=" WHERE "; $where .="MATCH ( employee_name, employee_salary) AGAINST ('%".$params['searchPhrase']."%') "; } } // getting total number records without any search $sql = "SELECT * FROM `employee` "; $sqlTot .= $sql; $sqlRec .= $sql; //concatenate search sql if value exist $sqlTot .= $where; $sqlRec .= $where; } if ($rp!=-1) $sqlRec .= " LIMIT ". $start_from .",".$rp; while( $row = mysqli_fetch_assoc($queryRecords) ) { $data[] = $row; } "rowCount" => 10, "rows" => $data // total data array ); return $json_data; }
emplayee_name i employee_salary mam ustawione jako full text.
Pomożcie proszę.
Widze ze forum bardzo pomocne :(ehh....