Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Management System

This is a simple Library Management System created using HTML, CSS, JavaScript, PHP, and MySQL. The project is designed to run on XAMPP and helps manage books in a small library. You can add, edit, delete, search, and view books through a clean and responsive interface.

Technologies Used

  • HTML5
  • CSS3
  • JavaScript
  • PHP
  • MySQL
  • XAMPP

Features

  • Dashboard with library statistics
  • Add new books
  • View all books
  • Edit book details
  • Delete books with a confirmation message
  • Search books by title, author, or category
  • Responsive blue and white user interface
  • Form validation using JavaScript and PHP
  • Secure database queries using prepared statements

Project Folder

library-management/
│
├── config/
│   └── db.php
│
├── css/
│   └── style.css
│
├── js/
│   └── script.js
│
├── index.php
├── add.php
├── edit.php
├── delete.php
├── search.php
├── library_db.sql
└── README.md

How to Run the Project

Step 1

Copy the project folder into the XAMPP htdocs folder.

C:\xampp\htdocs\library-management

Step 2

Open XAMPP and start:

  • Apache
  • MySQL

Step 3

Open your browser and go to:

http://localhost/phpmyadmin

Step 4

Import the database.

  • Create a database named library_db (optional).
  • Click the Import tab.
  • Select the library_db.sql file.
  • Click Go.

The books table and sample records will be created automatically.

Step 5

Open the project in your browser.

http://localhost/library-management/

The Library Management System should now be ready to use.

Database Settings

The database connection is inside:

config/db.php

Default settings are:

$host = "localhost";
$user = "root";
$password = "";
$database = "library_db";

If your MySQL password is different, update the $password value.

Database Table

books
Column Type
id INT
title VARCHAR(255)
author VARCHAR(255)
category VARCHAR(100)
quantity INT

Validation

The system checks that:

  • All fields are required.
  • Quantity must be a whole number.
  • Validation is done in both JavaScript and PHP.

Security

  • Prepared statements are used to prevent SQL injection.
  • htmlspecialchars() is used to display data safely.
  • Search input is checked before running queries.

Future Improvements

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages