Question: Question 3 [ 3 0 marks ] You are the head librarian at a local library. Your current system for managing books is outdated and
Question marks
You are the head librarian at a local library. Your current system for managing books
is outdated and inefficient. You decide to create a program to streamline book
management tasks like adding new arrivals, searching for specific titles, and keeping
track of the library's collection.
Required
Build a library management system using functions, arrays, a Book class, and PDO
for MySQL interaction.
Instructions:
In your program, create a book class with methods and functions to add, display, and
search for books in a database. Implement PDO for CRUD operations and a menudriven interface.
Create a Book class with properties like title, author, ISBN, and genre.
Implement methods in the Book class to:
a Set book information.
b Display book information.
Develop functions for:
a Adding a new book to the database addBook: This function should take
a Book object as input and insert its information into the books table in the
database.
b Displaying a list of all books displayBooks: This function should retrieve
book data from the database and display it in a userfriendly format eg
table
c Searching for a book by title searchBook: This function should allow the
user to enter a book title or part of it and search the database for matching
books.
Utilise PDO to connect to a MySQL database and perform CRUD Create Read,
Update, Delete operations on the books table. Note: you should only have
Create and Read functionalities
HSYD JulDecFARMV
Implement error handling for database connections and queries using trycatch
blocks.
Rubric
Criteria Possible Mark
Book Class
Functions: addBook, displayBooks and searchBook
Database schema and PDO to connect to a MySQL
database
Error handling for database connections and queries
using trycatch blocks.
Mark
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
