wiki:ImportantCase1

Version 8 (modified by 222039, 6 weeks ago) ( diff )

--

Приказ на сите книги

Актери

  • Најавен корисник

Чекор 1

Селектирање на "Books"

Чекор 2

Приказ на сите книги

$stmt = $conn->prepare("SELECT book.bookid, book.CoverImage, book.Title, book.Genre, book.PublishedYear, author.FirstName, author.LastName
                        FROM Book
                        INNER JOIN Book_Author ON Book.BookID = Book_Author.BookID
                        INNER JOIN Author ON Book_Author.AuthorID = Author.AuthorID
                        WHERE book.PublishedYear BETWEEN :year_from AND :year_to;
");
$stmt->bindParam(":year_from", $query_from, PDO::PARAM_STR);
$stmt->bindParam(":year_to", $query_to, PDO::PARAM_STR);
$stmt->execute();
$all_books = [];

while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  $all_books[] = $row;
}

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.