mirror of
https://github.com/Floriansylvain/projet_programmation_web.git
synced 2026-08-19 11:43:16 +02:00
✨ Added suggestion feature
This commit is contained in:
@@ -43,6 +43,29 @@ class dump {
|
||||
return $theses_array;
|
||||
}
|
||||
|
||||
public static function getAuthorsByAuthors(mixed $author_name) : array {
|
||||
$array = [];
|
||||
|
||||
$author_name = '%' . $author_name . '%';
|
||||
|
||||
$pdo_obj = new conf();
|
||||
$pdo = $pdo_obj->getPDO();
|
||||
|
||||
$stmt = $pdo->prepare("SELECT author FROM theses WHERE author LIKE :author_name LIMIT 10;");
|
||||
$stmt->bindParam(':author_name', $author_name, PDO::PARAM_STR, 100);
|
||||
$stmt->execute();
|
||||
|
||||
$i = 0;
|
||||
while ($obj = $stmt->fetchObject()) {
|
||||
foreach ($obj as $elem) {
|
||||
array_push($array, $elem);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function sendThese() {
|
||||
$data = [
|
||||
'author' => $this->these->getAuthor(),
|
||||
|
||||
Reference in New Issue
Block a user