0% found this document useful (0 votes)
2 views

PHP Homework 1

The document outlines a project to create a web application using PHP and MySQL for performing CRUD operations on a student database. It includes instructions for setting up a MySQL database, creating necessary PHP files for managing student records, and testing the application. The application will allow users to add, read, update, and delete student information from the database.

Uploaded by

olieee.2023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

PHP Homework 1

The document outlines a project to create a web application using PHP and MySQL for performing CRUD operations on a student database. It includes instructions for setting up a MySQL database, creating necessary PHP files for managing student records, and testing the application. The application will allow users to add, read, update, and delete student information from the database.

Uploaded by

olieee.2023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise: CRUD Operations in PHP with MySQL‬

‭bjective:‬
O
Create‬ ‭
‭ a‬ ‭
simple‬ ‭
web‬ ‭
application‬ ‭
that‬ ‭
allows‬ ‭
users‬ ‭
to‬ ‭
perform‬ ‭
CRUD‬
(Create,‬ ‭
‭ Read,‬ ‭
Update,‬ ‭
Delete)‬‭
operations‬‭ on‬‭
a‬‭MySQL‬‭database‬‭
using‬
PHP.‬

Instructions:‬

1. Setup Database:‬

- Create a MySQL database named `student_db`.‬

- Create a table named `students` with the following columns:‬

- `id` (INT, Primary Key, Auto Increment)‬

- `name` (VARCHAR(100))‬

- `email` (VARCHAR(100))‬

- `age` (INT)‬

2. Create PHP Files:‬



- `config.php`: Contains database connection settings.‬

-‬ ‭̀index.php`:‬ ‭
‭ Displays‬ ‭
the‬ ‭
list‬ ‭
of‬ ‭
students‬‭
and‬‭
provides‬‭
links‬
to add, edit, and delete records.‬

- `add.php`: Form to add a new student.‬

- `edit.php`: Form to edit an existing student.‬

- `delete.php`: Deletes a student record.‬

3. Testing:‬

-‬ ‭
‭ Test‬ ‭
the‬ ‭
application‬ ‭
by‬ ‭
adding,‬ ‭
editing,‬‭
and‬‭
deleting‬‭
student‬
records to ensure all CRUD operations work correctly.‬

You might also like