/php-mysql-crud

Performing CRUD with just one line of code. It can be integrated into your PHP projects.

Primary LanguagePHP

php-mysql-crud

Advantages:

  1. Easy to use: this script provides simple and easy-to-use functions to perform basic CRUD (Create, Read, Update, Delete) operations and image upload.
  2. Reusable: the script's functions can be used in multiple projects, saving time and effort.
  3. Error handling: the script checks for connection errors and displays informative error messages to the user.

Functions:

  1. createData: to create a new record in the database table.
  2. createDataWithImage: to create a new record in the database table with an uploaded image.
  3. readData: to retrieve data from the database table.
  4. readDataOne: to retrieve a single record from the database table.
  5. updateData: to update a record in the database table.
  6. updateDataWithImage: to update a record in the database table with an uploaded image.
  7. deleteData: to delete a record from the database table.
  8. joinTables: to combine data from two or more tables in a database into a single integrated output.

How to use:

  1. Import the PHP file (functions.php) to your project.
  2. Set the database connection details (host, username, password, and database name) in the script.
  3. Use the provided functions to perform CRUD operations and image upload as needed.
  • You can read the how_to_use.php file to get a clearer understanding of how to use it.
  • Note: This script is not intended for production use as it does not implement any security measures to protect against SQL injection attacks. Please use this script for learning purposes only.