searpl
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
if (isset($_GET['q']) && preg_replace('/\s+/', '', $_GET['q']) != '') {
$sql = "SELECT title,url,snippet(indexed,2,'
','','...',15) as snippet FROM indexed WHERE indexed MATCH ? ORDER BY bm25(indexed,2,2,1)";
$params = [$_GET['q']];
$stmt = $db->prepare($sql);
set_error_handler(function ($_,$msg) {echo '
';}, E_WARNING);
$stmt->execute($params);
restore_error_handler();
$results = false;
while ($row = $stmt->fetch()) {
$results = true;
?>
No results.
';
} else {
?>