Worked example · PHP and MySQL
Library Management System source code
A library management system for a polytechnic that tracks books, members, loans, fines and reports. Staff add records with optional CSV uploads, issues are limited by availability and borrowing caps, and the whole system runs offline in XAMPP.
A real system made by the same builder you would use. Yours is built for your own topic and answers, so its screens and tables will differ. This example is not a source-code download.
The problem it solves
The polytechnic library needs a reliable offline way to record books and members, control issuing and returning, and see fines and reports. Paper registers cause double issues, lost overdue slips and slow reporting.
Project topic: Design and Implementation of a Library Management System
Who uses it
admin
Manages books, members, users, loans, fines and reports.
- Add, edit and deactivate books and members
- Upload CSV files for books and members
- Issue, renew and return books
- Record simulated fine payments
- View and print all reports and receipts
attendant
Issues and returns books at the desk.
- Issue, renew and return books
- Record simulated fine payments
- View and print loans and receipts
student
Searches the catalogue and sees own loans.
- Search and view book availability
- View own loan history and fines
lecturer
Searches the catalogue and sees own loans.
- Search and view book availability
- View own loan history and fines
What it does
Library dashboard
Shows headline figures: total books, available copies, active members, active loans, overdue loans, total fines due. Includes a loans per month or category chart.
Book management
Add, edit and deactivate books with title, author, ISBN, category and copies. Update copies when new stock arrives. Show all books with search and pagination. CSV upload with validated columns and per-row failure report.
Member management
Add, edit and deactivate members with name, number, department and status. Show all members with search and pagination. CSV upload with validated columns and per-row failure report.
Catalogue search
Search books by title, author, ISBN or category. Shows availability and copy counts while keeping internal details hidden from students.
Issue, renew, return and fines
Issue a book to a member only when a copy is available and the member has under three active loans. Set due date two weeks ahead. Renew extends the due date; overdue renewals require a simulated fine. Return marks the loan returned, restores availability and calculates fines at ₦50 per day overdue. Fine payment is recorded as simulated. The page shows both the issue form and the current loans list with detail.
Receipts and printed reports
Printable issue receipt for a loan, current loans list, overdue loans with fines, full catalogue and a date-range loan report. The report page uses print styles and includes the issue receipt directly.
Screenshots
Screenshots of the running system, taken by our checks. The records are sample data and are labelled so on each page.






Database tables
- usersLocal sign-in accounts with a hashed password and one role.id, username, password_hash, role
- settingsSmall flags kept between setup runs, including whether sample records were seeded.name, value
- booksCatalogue of titles and the total number of copies owned.id, title, author, isbn, category, copies_total, copies_available, active
- membersRegistered library members and whether each may borrow.id, name, member_number, department, active, suspended
- loansIssue, renewal and return history. Each row is one copy out on loan.id, book_id, member_id, borrowed_on, due_on, returned_on, renew_count, fine_amount, fine_paid
Technology
- PHP. The student chose PHP, and it runs on XAMPP with no extra tooling.
- PDO (pdo_mysql) with MySQL/MariaDB. Ships with XAMPP and matches the offline requirement.
- Bootstrap 5. Bundled with the kit so the pages work offline on a laptop.
- Chart.js. Bundled with the kit so the chart needs no internet connection.
- Vanilla JavaScript and the browser print dialog. No framework is needed and the pages stay offline.
How to run it: running a PHP project on XAMPP. Not sure which language to pick? Python or PHP.
How it was tested
89 of 89 tests passed, 89 of them automated. The system was also installed from scratch and every screen was opened as the right kind of user before it was accepted.
What it does not do
- No real email, SMS, online payment, barcode scanner or mobile app. Fine payments are simulated and labelled.
- No public anonymous browsing of the catalogue. Students and lecturers must sign in.
- No reservation queue and no automatic overdue reminder.
- Copies are tracked as a count only. The system does not track individual copy numbers.
- All assets run offline from the project folder, with no Composer, Node or CDN libraries.
- The automated checks ran on PHP 8.2 with MariaDB on a private Linux server, and the pages were inspected in a browser on macOS. Windows with XAMPP and PHP 7.4 were not run in this build, and concurrent desk load was not tested.
Chapters 3 and 4 from this system
With the MonoEd FYP Generator, signed in with the same Google account, press “Use my working system” when you write Chapter 3 or 4. Its real users, 5 database tables, screenshots and 89 test results go into the chapters, laid out under your supervisor's headings. Nothing is invented: anything the system cannot show, such as a user test, is left for you to fill in.
Want a library management system for your own school or business case?
Get a system built for your topic, with a guide, defence questions and screenshots. Plan it free, then ₦13,500 only if you want it built. View pricing.
Start with this topic