Introduction to Event Management System Project in PHP
An Event Management System is a powerful web application that helps organize, plan, and manage events efficiently. Whether you’re planning a wedding, corporate meeting, birthday party, or any other event, this system makes the process much easier. Built with PHP and MySQL, this project is perfect for students who want to learn web development and create something useful at the same time.
This project teaches you important programming concepts like database management, user authentication, form handling, and creating a complete web application from scratch. You’ll learn how to connect PHP with MySQL, create different user roles, and build a professional-looking interface that real businesses can use.
Project Overview
The Event Management System is a web app built with PHP and MySQL. It helps you plan and organize different kinds of events, like booking services, managing clients, and scheduling events.
This is useful for students, event planners, or small businesses who want a simple way to keep track of their events. It has an easy interface and different logins for admins and users, so everything is managed properly.
Project Details
| Project Name | Event Management System |
| Category | Web Application |
| Language/s Used | PHP, MySQL |
| PHP Version (Recommended) | 5.6.3, 7.4.12 |
| Database | MySQL |
| Type | Web Application |
Available Features
- Login and Logout
- Event Management Module
- Service Management
- Booking Management
- User Management
- Generate Report
Step-by-Step Development Guide
Step 1: Setting Up the Database
First, create a MySQL database for your project. Here’s the basic database structure:
-- Create database
CREATE DATABASE event_management;
USE event_management;
-- Users table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
password VARCHAR(255) NOT NULL,
role ENUM('admin', 'user') DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Events table
CREATE TABLE events (
id INT AUTO_INCREMENT PRIMARY KEY,
event_name VARCHAR(200) NOT NULL,
event_date DATE NOT NULL,
event_time TIME NOT NULL,
venue VARCHAR(200) NOT NULL,
description TEXT,
user_id INT,
status ENUM('pending', 'approved', 'cancelled') DEFAULT 'pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);
-- Services table
CREATE TABLE services (
id INT AUTO_INCREMENT PRIMARY KEY,
service_name VARCHAR(100) NOT NULL,
price DECIMAL(10,2) NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Step 2: Database Connection
Create a file called `config.php` to handle database connection:
<?php
// Database configuration
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "event_management";
try {
// Create connection using PDO
$pdo = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
Step 3: User Registration and Login System
Create `login.php` for user authentication:
<?php
session_start();
include 'config.php';
if ($_POST) {
$email = $_POST['email'];
$password = $_POST['password'];
// Check if user exists
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
$stmt->execute([$email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
$_SESSION['role'] = $user['role'];
// Redirect based on role
if ($user['role'] == 'admin') {
header("Location: admin_dashboard.php");
} else {
header("Location: user_dashboard.php");
}
} else {
$error = "Invalid email or password";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login - Event Management System</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="login-container">
<h2>Login to Event Management System</h2>
<?php if (isset($error)): ?>
<div class="error"><?php echo $error; ?></div>
<?php endif; ?>
<form method="POST">
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Password" required>
<button type="submit">Login</button>
</form>
<p><a href="register.php">Don't have an account? Register here</a></p>
</div>
</body>
</html>
Step 4: Event Management Module
Create `add_event.php` to handle event creation:
<?php
session_start();
include 'config.php';
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
if ($_POST) {
$event_name = $_POST['event_name'];
$event_date = $_POST['event_date'];
$event_time = $_POST['event_time'];
$venue = $_POST['venue'];
$description = $_POST['description'];
$user_id = $_SESSION['user_id'];
// Insert event into database
$stmt = $pdo->prepare("INSERT INTO events (event_name, event_date, event_time, venue, description, user_id) VALUES (?, ?, ?, ?, ?, ?)");
if ($stmt->execute([$event_name, $event_date, $event_time, $venue, $description