Question: Provide a PHP code that will create a program to streamline book management tasks like adding new arrivals, searching for specific titles, and keeping track
Provide a PHP code that will create a program to streamline book
management tasks like adding new arrivals, searching for specific titles, and keeping track of the library's collection.
Take note "The code should build a library management system using functions, arrays, a Book class, and PDO for MySQL interaction. NB: i am using eclipse PHP and ampps
The main.php should allow the user to populate the library on a web page with modern design and not inside the CLI application within PHP
Follow below instruction
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
Implement error handling for database connections and queries using trycatch
blocks.
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
