This is a PHP & MySQL-based Employee Management System that performs full CRUD operations on employees, departments, and projects. It showcases many-to-one and many-to-many relationships through intermediate tables.
🔗 Live Website: http://employee.infinityfreeapp.com
- Frontend: HTML, CSS, JavaScript
- Backend: PHP
- Database: MySQL (via phpMyAdmin)
- Local Server: XAMPP
The system uses a relational schema consisting of the following tables:
- employee: Stores employee details
- department: Contains department information
- project: Project records
- works_for: Links employees to departments (many-to-one)
- works_on: Links employees to projects (many-to-many)
- Add, edit, delete, and view Employees
- Assign employees to Departments
- Add and manage Projects
- Track which employees are working on which Projects
- Perform CRUD operations on all entities
- Relational integrity between tables
- XAMPP (Install from https://www.apachefriends.org)
- Web browser (Chrome/Firefox recommended)
Place your project folder (e.g., employee-management) into the htdocs directory of XAMPP:
C:\xampp\htdocs\employee-management
- Open XAMPP Control Panel
- Start both Apache and MySQL
- Open browser → go to http://localhost/phpmyadmin
- Click New → create a database (e.g.,
ems) - Import the provided
ems.sqlfile:- Click Import
- Choose
ems.sql(in your project folder) - Click Go
Ensure database.php in your project contains the correct database credentials:
<?php
$host = "localhost";
$username = "root";
$password = "";
$database = "ems";
$conn = mysqli_connect($host, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>Open your browser and visit:
http://localhost/employee-management/index.php
Start adding employees, departments, and projects!
employee-management/
├── index.php
├── employee/
│ ├── add.php
│ ├── edit.php
│ └── delete.php
├── department/
│ └── ...
├── project/
│ └── ...
├── database.php
├── ems.sql
└── assets/
├── css/
└── js/
Pull requests and suggestions are welcome. Help improve this system by:
- Adding search/filter
- Export to Excel/PDF
- Login/Authentication
Developed as a part of academic coursework to understand database relationships and PHP-based web development.
This project is open for educational and personal use.