Version 9 (modified by 4 days ago) ( diff ) | ,
---|
Детален приказ на книга
Актери
- Најавен корисник
Чекор 1
Корисникот ја избира книгата за која сака да види подетални информации
Чекор 2
$sql = "SELECT book.*, book_details.*, firstname, lastname, author_description, author_image FROM book INNER JOIN book_author ON book.bookid = book_author.bookid INNER JOIN author ON book_author.authorid = author.authorid INNER JOIN book_details ON book.bookid = book_details.bookid WHERE book.bookid = :bookid; "; $stmt = $conn->prepare($sql); $stmt->bindParam(':bookid', $param, PDO::PARAM_INT); $sql2 = "SELECT b.BookID, b.TotalCopies - COALESCE(COUNT(l.LoanID), 0) AS AvailableCopies FROM Book b LEFT JOIN Loan l ON l.BookCopyID IN (SELECT CopyID FROM Book_Copies WHERE BookID = b.BookID) AND l.Status IN ('On Time', 'Soon', 'Overdue') WHERE b.BookID = :bookid GROUP BY b.BookID, b.TotalCopies;";
Чекор 3
Attachments (3)
- BT-DB-2.png (236.2 KB ) - added by 4 days ago.
- BT-DB-1.png (88.1 KB ) - added by 4 days ago.
- BT-DB-3.png (118.4 KB ) - added by 4 days ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.