1 2 3 4 5 6 7 8 9 10 11 12 13
| function searchPersons(int $idAbo, string $qString): array|false {
$db = dbConnect();
$sql = <<<SQL
SELECT id, lastname, firstname, CONCAT( COALESCE(birthday, '--'), '/', COALESCE(birthmonth, '--'), '/', COALESCE(birthyear, '----') ) AS birthdate,
CONCAT(id, lastname, firstname, birthdate) AS searchString
FROM dat_persons
WHERE id_abo=:id_abo AND searchString LIKE '%:qString%'
SQL;
$stmt = $db->prepare($sql);
$stmt->execute([':id_abo'=>$idAbo, ':qString'=>$qString]);
return $stmt->fetchAll();
} |
Partager