safer
All checks were successful
Build and push / Pulling repo on server (push) Successful in 2s

This commit is contained in:
Chris 2023-11-26 14:10:26 +01:00
parent a67d1eb05b
commit a20749d900

View File

@ -20,8 +20,11 @@ class Smart extends Page {
$q = $_REQUEST['q']; $q = $_REQUEST['q'];
if(!$q || strlen($q) < 3 || strpos($q, ' ') === false) if(!$q || strlen($q) < 3 || strpos($q, ' ') === false)
return partial('error.html', ['errorTitle' => 'Error', 'errorMessage' => 'Error: Bitte Nachname und Vorname eingeben.']); return partial('error.html', ['errorTitle' => 'Error', 'errorMessage' => 'Error: Bitte Nachname und Vorname eingeben.']);
$query = "SELECT DISTINCT(hund) FROM results WHERE teilnehmer LIKE '$q'";
$res = $db->query($query); $stmt = $db->prepare("SELECT DISTINCT(hund) FROM results WHERE teilnehmer LIKE :q");
$stmt->bindValue(':q', $q, SQLITE3_TEXT);
$res = $stmt->execute();
$results = []; $results = [];
$dogs = []; $dogs = [];