DATABASE PROJECT REPORT
1. Introduction
This report documents the process of designing, developing, and implementing a database
project using tools like XAMPP, VS Code, and a local server.
The project aims to create a functional database system for [specific use case, e.g., library
management, e-commerce, hospital management].
2. Tools and Technologies Used
❖ XAMPP:
A cross-platform web server solution stack used for local development. It includes Apache
(web server), MySQL (database), and PHP (server-side scripting).
❖ VS Code:
A lightweight and powerful code editor used for writing and debugging code.
❖ MySQL:
A relational database management system (RDBMS) for storing and managing data.
❖ PHP
A server-side scripting language used to interact with the database and generate dynamic
content.
❖ HTML/CSS/JavaScript:
For creating the frontend user interface.
❖ Browser:
For testing and interacting with the application.
3. Project Setup
3.1 Installing XAMPP
1. Downloading and install XAMPP from the official website.
2. Starting the Apache and MySQL services from the XAMPP Control Panel.
3. Verifying the installation by accessing `http://localhost` in your browser. The XAMPP
dashboard will appear.
3.2 Setting Up VS Code.
1. InstallingVS Code from the official website.
2. Installing extensions the PHP Intelephense (for PHP support) and Live Server (for frontend
testing).
3. Creating a project folder and open it in VS Code.
4. Database Implementation
4.1 Creating the Database
1. Opening `http://localhost/phpmyadmin` in your browser.
2. Create a new database (e.g., `form`)in my project.
3. Create tables using SQL commands or the phpMyAdmin interface.
Example SQL for `data` table : (WHEN USING SQL COMMANDS)
CREATE TABLE Books (
ID INT AUTO_INCREMENT PRIMARY KEY,
VARCHAR(255) NOT NULL,
VARCHAR(255) NOT NULL,
VARCHAR(13) UNIQUE NOT NULL
);
4.2 Inserting Sample Data
Insert sample data into the tables for testing.
Example:
$sql="insert into 'data'(email,password,first name,
surname,contacts,message)values('$email','$password','$firstName','$surname',
'$contacts','$message')";
5. Backend Development (PHP).
5.1 Connecting to the Database
- Create a PHP script (`connect.php`) to connect to the MySQL database.
Example:
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "form";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
<?php
$con =new mysqli('localhost','root','','form');
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
echo "Connected successfully";
?>
6. Frontend Development
6.1 HTML/CSS.
- Create a user interface for interacting with the database.
Example: A form showing interface:
<form action="" method="post">
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Your email"
required>
<label for="password">password</label>
<input type="password" id="password" name="password" placeholder="Your
password" required>
<label for="First Name">First Name</label>
<input type="text" id="name" name="FirstName" placeholder="First Name"
required>
<label for="Surmame">Surmame</label>
<input type="text" id="Surmame" name="Surmame" placeholder="Surmame"
required>
<label for="Contacts">Phone Contacts:(+255)</label>
<input type="tel" id="Contacts" name="Contacts" placeholder=" 74*****0"
required>
<label for="message">Message:</label>
<textarea id="message" name="message" rows="5" placeholder="Your message"
required></textarea>
<div class="btn">
<button type="submit">Submit</button>
</div>
</form>
6.2 Testing with Live Server
- Use the Live Server extension in VS Code to test the frontend in a browser.
My browser in this case I have considered the CHROME BROWSER.
7. Challenges and Solutions
❖ Challenge: Database connection issues.
Solution: Ensure the MySQL service is running in XAMPP and the credentials in
`connect.php` are correct.
❖ Challenge: SQL injection vulnerabilities.
Solution: Use prepared statements in PHP to prevent SQL injection.
8. Conclusion
This project successfully demonstrates the creation of a database system using XAMPP, VS
Code, and a local server. The system meets the requirements and provides a scalable solution for
[specific use case].There will be more Future enhancements in this project.
REFERENCES
❖ XAMPP Documentation:
[https://www.apachefriends.org/](https://www.apachefriends.org/)
❖ VS Code Documentation:
[https://code.visualstudio.com/docs](https://code.visualstudio.com/docs)
❖ PHP Manual:
[https://www.php.net/manual/en/](https://www.php.net/manual/en/)
❖ MySQL Documentation:
[https://dev.mysql.com/doc/](https://dev.mysql.com/doc/)