Address changes.
This commit is contained in:
parent
a5949e0401
commit
635b3ddcbc
59 changed files with 7249 additions and 2745 deletions
|
@ -52,4 +52,17 @@ class Genres
|
|||
$stmt->close();
|
||||
return $genres;
|
||||
}
|
||||
|
||||
public function search(string $query, int $page = 1, int $resultsPerPage = 10): array {
|
||||
$offset = ($page - 1) * $resultsPerPage;
|
||||
$likeQuery = "%" . $query . "%";
|
||||
$stmt = $this->db->prepare("SELECT * FROM genres WHERE name LIKE ? LIMIT ?, ?");
|
||||
$stmt->bind_param("sii", $likeQuery, $offset, $resultsPerPage);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$genres = $result->fetch_all(MYSQLI_ASSOC);
|
||||
$stmt->close();
|
||||
return $genres;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue