PHP Classes

PHP Simple CRUD with MySQL: Generate SQL and forms to perform CRUD operations

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 464 All time: 6,052 This week: 455Up
Version License PHP version Categories
php-crud-mysql 1.0.1GNU General Publi...5HTML, PHP 5, Databases
Description 

Author

This class can generate SQL and forms to perform CRUD operations.

It can take the name of a table and fields and can generate SQL INSERT, UPDATE and DELETE queries to manipulate records of that table in a MySQL database.

The class can also generate HTML to edit table record data in a Web page.

Picture of Muhammad Mahbubur Rahman
  Performance   Level  
Name: Muhammad Mahbubur Rahman <contact>
Classes: 1 package by
Country: United States United States
Age: 35
All time rank: 3362452 in United States United States
Week rank: 305 Up35 in United States United States Up

Example

<?php
include("crudClass.php");

$con = $crud->db_con('localhost','root','mysql','crud');// Connect Database

$crud = new crudClass('kitchen','instrument,code,type');// Initiate the class with table information

if($_POST['submit']){
   
$create_sql = $crud->create();//Fetch INSERT query
   
mysqli_query($con,$create_sql);
}
if(
$_POST['update']){
   
$update_sql = $crud->update($_POST['id']);//Fetch UPDATE query
   
mysqli_query($con,$update_sql);
}
if(
$_POST['delete']){
   
$delete_sql = $crud->delete($_POST['id']);//Fetch DELETE query
   
mysqli_query($con,$delete_sql);
}

echo
$crud->create_form();//Prepare data entry form
echo '<hr>';
echo
$crud->renderVertically();//READ and SHOW data

if($_POST['edit']){
    echo
'<hr>';
    echo
$crud->renderEditor($_POST['id']);//Prepare data edit form
}
?>


Details

How the package is useful ..

This package will make your programming easy where you just need CRUD operations.

What the package will do ..

The program will take a Table Name and Fields Name of the table as argument then provide all CRUD operations for the table.

How to use ..

Please follow the example file crud_example.php


  Files folder image Files  
File Role Description
Plain text file crudClass.php Class Main class file
Accessible without login Plain text file documentation.txt Doc. Documentation
Accessible without login Plain text file crud_example.php Example Simple example to use the class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:464
This week:0
All time:6,052
This week:455Up