Skip to content

zishnusarker/Student-Database-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Student Database Management System

A PHP/MySQL web application for managing student records, courses, and subjects - featuring a dashboard, full CRUD operations, session-based authentication, and a Singleton database pattern.

PHP MySQL Bootstrap Category Course

Overview โ€ข Features โ€ข Tech Stack โ€ข Database โ€ข Architecture โ€ข Installation โ€ข Usage


๐Ÿ“– Overview

A full-stack web application for student information management, built with PHP and MySQL. The system allows administrators to manage students, courses, and subjects through a clean dashboard interface with complete Create, Read, Update, and Delete (CRUD) operations.

This was developed as a 3rd semester B.Tech project demonstrating practical database management, server-side scripting, MVC-like architecture, and the Singleton design pattern.


โœจ Features

๐Ÿ‘จโ€๐ŸŽ“ Student Management

  • Register new students with personal and academic details (name, gender, guardian, income, category, phone, email, course, session)
  • View all enrolled students in a tabular format
  • Edit student records
  • Delete student entries

๐Ÿ“š Course Management

  • Add new courses with short name, full name, and date
  • View all available courses
  • Edit course details
  • Delete courses
  • Check course availability

๐Ÿ“ Subject Management

  • Add subjects linked to courses (up to 3 subjects per entry)
  • View all subjects
  • Edit subject details
  • Delete subjects

๐Ÿ” Authentication & Security

  • Admin login with session management
  • Session-based page protection
  • Logout functionality
  • Prepared statements for SQL injection prevention (bind_param)

๐Ÿ“Š Dashboard

  • Admin dashboard with statistics overview
  • Morris.js and Flot data visualizations
  • Quick access to all management modules

๐Ÿ›  Tech Stack

Category Technology Purpose
Backend PHP 7.x Server-side logic and routing
Database MySQL Relational data storage
DB Pattern Singleton (Database.php) Single shared DB connection
Frontend HTML5 / CSS3 Page structure and styling
UI Framework Bootstrap (via Bower) Responsive layout and components
Charts Morris.js, Flot Dashboard data visualizations
JavaScript Vanilla JS Client-side interactions and alerts
Server Apache (XAMPP/WAMP/LAMP) PHP-capable web server
Package Manager Bower Frontend dependency management

๐Ÿ—„๏ธ Database Schema

Database name: schoolmanagement

The system manages the following data entities:

Entity Key Fields Operations
Login loginid, password Authentication
Courses course_short, course_full, date Full CRUD
Subjects course_ref, subject1, subject2, subject3 Full CRUD
Students name, gender, guardian, course, session, phone, email, income, category Full CRUD
Sessions session year/period Reference data
Countries country list Reference data for registration

Default login credentials:

Username: admin
Password: admin

๐Ÿ— Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Browser (Client)                         โ”‚
โ”‚     Dashboard โ”‚ Students โ”‚ Courses โ”‚ Subjects โ”‚ Login     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚ HTTP
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    PHP Backend                            โ”‚
โ”‚                                                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚              pages/                               โ”‚    โ”‚
โ”‚  โ”‚  dashboard.php    login.php     session.php       โ”‚    โ”‚
โ”‚  โ”‚  register.php     view.php      edit-std.php      โ”‚    โ”‚
โ”‚  โ”‚  add-course.php   view-course.php  edit-course.phpโ”‚    โ”‚
โ”‚  โ”‚  add-subject.php  view-subject.php edit-sub.php   โ”‚    โ”‚
โ”‚  โ”‚  leftbar.php      logout.php    dbcontroller.php  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                       โ”‚                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚              config/                              โ”‚    โ”‚
โ”‚  โ”‚  Database.php  โ”€โ”€  Singleton connection manager   โ”‚    โ”‚
โ”‚  โ”‚  DbFunction.php โ”€โ”€ All CRUD operations            โ”‚    โ”‚
โ”‚  โ”‚     โ€ข login()         โ€ข register()                โ”‚    โ”‚
โ”‚  โ”‚     โ€ข create_course() โ€ข edit_course()             โ”‚    โ”‚
โ”‚  โ”‚     โ€ข create_subject()โ€ข edit_subject()            โ”‚    โ”‚
โ”‚  โ”‚     โ€ข showStudents()  โ€ข del_course()              โ”‚    โ”‚
โ”‚  โ”‚     โ€ข showCourse()    โ€ข del_std()                 โ”‚    โ”‚
โ”‚  โ”‚     โ€ข showSubject()   โ€ข del_subject()             โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                       โ”‚                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚ mysqli
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                MySQL Database                             โ”‚
โ”‚               schoolmanagement                            โ”‚
โ”‚  tbl_login โ”‚ tbl_courses โ”‚ tbl_subjects โ”‚ tbl_students   โ”‚
โ”‚  tbl_session โ”‚ tbl_country                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Design Patterns Used

Pattern Implementation Purpose
Singleton Database.php Ensures only one DB connection exists throughout the application
Data Access Object (DAO) DbFunction.php Centralizes all database queries in one class
Session Guard session.php Protects pages from unauthorized access

๐Ÿš€ Installation

Prerequisites

  • XAMPP / WAMP / LAMP (Apache + PHP + MySQL)
  • Web browser

Setup Steps

# 1. Clone the repository
git clone https://github.com/zishnusarker/A-Student-Database-Management-System-.git

# 2. Copy the project to your web server directory
# The actual app code is inside this nested path:
#   Student Management System/std php/std php/

# For XAMPP (Windows):
xcopy "Student Management System\std php\std php" C:\xampp\htdocs\student-mgmt /E /I

# For XAMPP (Linux/Mac):
cp -r "Student Management System/std php/std php/" /opt/lampp/htdocs/student-mgmt

Database Setup

  1. Start Apache and MySQL from XAMPP/WAMP control panel
  2. Open phpMyAdmin at http://localhost/phpmyadmin
  3. Create a new database:
    CREATE DATABASE schoolmanagement;
  4. Import the schema:
    • Click on schoolmanagement database
    • Go to Import tab
    • Select schoolmanagement.sql from the project folder
    • Click Go

Access the Application

http://localhost/student-mgmt/index.php

Login with:

Username: admin
Password: admin

๐Ÿ“‹ Usage

Dashboard

After login, the dashboard provides an overview with quick access links to all modules.

Managing Students

  • Add Student - Fill in personal details, select course and session, submit
  • View Students - Browse all enrolled students in a table
  • Edit Student - Click edit on any record, modify fields, save
  • Delete Student - Remove a student record permanently

Managing Courses

  • Add Course - Enter course short name, full name, and date
  • View Courses - List all courses with edit/delete actions
  • Course Availability - Check which courses are currently active

Managing Subjects

  • Add Subject - Link up to 3 subjects to a course
  • View Subjects - See all subject entries
  • Edit/Delete - Modify or remove subject records

๐Ÿ“ Project Structure

A-Student-Database-Management-System-/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ .gitattributes
โ”‚
โ””โ”€โ”€ Student Management System/
    โ””โ”€โ”€ std php/std php/                    # Main application root
        โ”œโ”€โ”€ index.php                       # Entry point
        โ”œโ”€โ”€ schoolmanagement.sql            # Database schema
        โ”œโ”€โ”€ READ ME FIRST !!!!.txt          # Original setup instructions
        โ”‚
        โ”œโ”€โ”€ config/                         # Database layer
        โ”‚   โ”œโ”€โ”€ Database.php                # Singleton DB connection
        โ”‚   โ””โ”€โ”€ DbFunction.php             # All CRUD operations (18 functions)
        โ”‚
        โ”œโ”€โ”€ pages/                          # Application pages (17 files)
        โ”‚   โ”œโ”€โ”€ login.php                   # Admin login
        โ”‚   โ”œโ”€โ”€ logout.php                  # Session destroy
        โ”‚   โ”œโ”€โ”€ session.php                 # Session guard
        โ”‚   โ”œโ”€โ”€ dashboard.php               # Main dashboard
        โ”‚   โ”œโ”€โ”€ leftbar.php                 # Sidebar navigation
        โ”‚   โ”œโ”€โ”€ dbcontroller.php            # Form action handler
        โ”‚   โ”œโ”€โ”€ register.php                # Student registration
        โ”‚   โ”œโ”€โ”€ view.php                    # View all students
        โ”‚   โ”œโ”€โ”€ edit-std.php                # Edit student
        โ”‚   โ”œโ”€โ”€ add-course.php              # Add course
        โ”‚   โ”œโ”€โ”€ view-course.php             # View courses
        โ”‚   โ”œโ”€โ”€ edit-course.php             # Edit course
        โ”‚   โ”œโ”€โ”€ course_availability.php     # Check availability
        โ”‚   โ”œโ”€โ”€ add-subject.php             # Add subject
        โ”‚   โ”œโ”€โ”€ view-subject.php            # View subjects
        โ”‚   โ”œโ”€โ”€ edit-sub.php                # Edit subject
        โ”‚   โ””โ”€โ”€ subject.php                 # Subject details
        โ”‚
        โ”œโ”€โ”€ dist/                           # Static assets (CSS, JS, images)
        โ”œโ”€โ”€ bower_components/               # Frontend libraries (Bootstrap, etc.)
        โ””โ”€โ”€ js/                             # Chart data files
            โ”œโ”€โ”€ flot-data.js                # Flot chart data
            โ””โ”€โ”€ morris-data.js              # Morris chart data

๐ŸŽ“ Key Concepts Demonstrated

What is the Singleton Design Pattern?

The Singleton pattern ensures a class has only one instance and provides a global access point to it. In this project, Database.php uses Singleton to maintain a single MySQL connection throughout the application - preventing multiple redundant connections that waste server resources.

Key elements: private constructor, private static instance variable, public getInstance() method, and a private __clone() to prevent duplication.

Why use Prepared Statements?

DbFunction.php uses prepared statements ($mysqli->prepare() + $stmt->bind_param()) instead of concatenating user input into SQL strings. This prevents SQL injection attacks - one of the most common web vulnerabilities (OWASP Top 10). The database treats bound parameters as data, never as executable SQL code.

What is Session-Based Authentication?

PHP sessions store user state between page requests. After a successful login, a session variable is set. The session.php guard checks for this variable on every protected page - redirecting unauthenticated users back to the login page. logout.php destroys the session.

What is the DAO pattern?

The Data Access Object (DAO) pattern separates database operations from business logic. DbFunction.php serves as the DAO - all SQL queries are centralized in one class with clearly named functions (create_course(), showStudents(), del_subject(), etc.). This makes the code maintainable and changes to the database only affect one file.


๐Ÿ”ฎ Future Improvements

  • Migrate from Bower to npm or CDN-based dependencies
  • Add password hashing (bcrypt) instead of plaintext storage
  • Implement CSRF token protection on forms
  • Add input sanitization and server-side validation
  • Implement role-based access control (admin vs teacher vs student)
  • Add search and filtering on list views
  • Implement pagination for large datasets
  • Add student attendance and grade tracking modules
  • Migrate to PDO from mysqli for better portability
  • Add responsive mobile layout improvements
  • Implement RESTful API endpoints for future frontend integration

โš ๏ธ Security Note

This is an educational project. It uses default credentials (admin/admin) and plaintext password storage. For production use, you would need to implement password hashing, CSRF protection, input sanitization, HTTPS, and proper access controls.


๐Ÿ“„ License

This project is available as open source.


Made with โค๏ธ as a B.Tech 3rd Semester Database Project

About

PHP/MySQL student database management system with full CRUD operations, Singleton DB pattern, session-based authentication, and a dashboard with data visualizations (B.Tech 3rd Semester Project)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors