This project provides a basic CRUD (Create, Read, Update, Delete) system using PHP (MySQLi) and MySQL. The included files handle database interactions, menu navigation, and data management.
config.php– Database connection settings.index.php– Main/home page.menu.php– Navigation menu.footer.php– Footer (copyright page).
add.php– Add new records.list.php– Display records in a table.list2.php– Display data from two related tables.update.php– Update existing records.delete.php– Delete records.
ims506.sql– Sample database structure and dummy data (recommended import format).ims506.csv– Sample data in CSV format for import.
dropMenu.php– Dropdown menu selection for "pelanggan" (customers).
Edit config.php to match your hosting settings (Lines 4-7):
$host = "localhost";
$username = "your_username"; // Change from 'root' if needed
$password = "your_password"; // Set your database password
$database = "your_database_name"; // Change from 'ims506' to your DB name
$conn = new mysqli($host, $username, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}Modify index.php to fit your project’s content and requirements.
$sql = "SELECT * FROM pelanggan"; // Change 'pelanggan' to your table name <th>ID</th>
<th>Name</th>
<th>Father's Name</th><td> <?= $row["idPelanggan"]; ?> </td>
<td> <?= $row["namaSendiri"]; ?> </td>
<td> <?= $row["namaBapa"]; ?> </td>Update ["] to match your database structure.
Modify the SQL query to retrieve related data using primary and foreign keys.
Modify menu items as needed.
$sql = "SELECT * FROM pelanggan"; // Change 'pelanggan' to your table name if (empty(trim($_POST["idPelanggan"]))) { // Change 'idPelanggan' to your primary key Modify variable assignments:
$idPelanggan = trim($_POST['idPelanggan']);
$namaSendiri = trim($_POST['namaSendiri']);
$namaBapa = trim($_POST['namaBapa']);Make sure these match your database columns.
($_POST['idPelanggan']), ($_POST['namaSendiri']), ($_POST['namaBapa'])Modify as needed if you have more fields.
This is a basic CRUD system that you must modify to fit your project’s needs. You may also use any CRUD template from the internet at your own risk.
This project is based on W3Schools PHP & MySQL tutorials and has been modified for better functionality. You are free to integrate frameworks or enhance the UI/UX as needed.
This version makes the guide easier to read and follow while maintaining clarity and structure. 🚀 Let me know if you need further refinements!