Giter VIP home page Giter VIP logo

simple-crud-php's Introduction

Simple Create, Read, Update, Delete (CRUD) in PHP & MySQL

This is a basic CRUD (Create, Read, Update, Delete) system implemented in PHP and MySQL. It allows you to add, edit, delete, and view user data.

Prerequisites

Before running this project, ensure you have the following installed:

  • PHP
  • MySQL
  • A web server (e.g., Apache)

Setup

  1. Import the database.sql file to create the necessary database and tables.
  2. Configure the database connection in dbConnection.php by updating the following variables:
    • $databaseHost: Hostname of your MySQL server
    • $databaseName: Name of the database
    • $databaseUsername: MySQL username
    • $databasePassword: MySQL password
  3. Place all PHP files (add.php, addAction.php, delete.php, edit.php, editAction.php, index.php) and dbConnection.php in your web server's directory.

Usage

  • Access index.php through your web browser to view the list of users.
  • From the homepage, you can:
    • Add New Data: Add a new user to the database.
    • Edit: Edit existing user data.
    • Delete: Delete a user from the database.

Files

  • add.php: Form to add new user data.
  • addAction.php: PHP script to handle adding user data.
  • delete.php: PHP script to delete user data.
  • edit.php: Form to edit existing user data.
  • editAction.php: PHP script to handle updating user data.
  • index.php: Homepage displaying a list of users.
  • dbConnection.php: PHP script to establish a connection with the MySQL database.

Note

  • This project uses MySQLi for database operations.
  • It is recommended to sanitize and validate user inputs before performing database operations to prevent SQL injection and other security vulnerabilities.

simple-crud-php's People

Contributors

pirulug avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.