Step 1: Database Table (db.php)
-
Create the
employees
table with columns forid
,name
,position
,office
,age
,start_date
, andsalary
.
Step 2: Config File (config.php)
-
This file sets up the MySQL database connection and defines the credentials to access the database.
Step 3: Index Page (index.php)
-
Displays a table with employee records fetched from the database. It allows viewing, updating, and deleting records.
Step 4: Create Record (create.php)
-
Allows users to create a new employee record by filling out a form. The form data is validated and then inserted into the database.
Step 5: Read Record (read.php)
-
Fetches and displays a single employee record based on the
id
passed via the URL.
Step 6: Error Page (error.php)
-
A page is displayed if there's an invalid request or a missing ID.
Step 7: CSS Styling (css/style.css)
-
Basic styling for the form and the table to make the UI visually appealing.
Step 8: JavaScript for DataTables (js.js)
-
Initializes and configures the DataTable with options for exporting data and column visibility.
With all the steps completed, you will have a functional CRUD application for managing employee data. The application will allow users to:
-
Create new employee records.
-
Read individual employee details.
-
Update existing records.
-
Delete records.
Additionally, you have implemented search, sorting, and export functionality using DataTables, making the app user-friendly and interactive.