PHP Classes

File: Example

Recommend this page to a friend!
  Classes of Muddathir Samir   PHP CRUD Library Trait   Example   Download  
File: Example
Role: Example script
Content type: text/plain
Description: Example
Class: PHP CRUD Library Trait
Manipulate database table records using a trait
Author: By
Last change: All you have to do is name your form elements with the same table fields of your database
for example, Student table (name,address,phone,email)
I will name my form inputs to the same names of my table
then you pass the post array to the save function
Date: Yesterday
Size: 535 bytes
 

Contents

Class file image Download
<?php session_start();
   
// this is an example of using curd trait
   
include '../../../inc/conn.php';
    include
'../../../classes/init.php';

 
       
$success = $inc->save('students',$_POST);
        if(
$success) {
           
$_SESSION['done'] = "Data Saved";
           
header("Location:../../index.php?view=inc");
            exit();
        }else {
           
$_SESSION['error'] = "Error Happend try a gain";
           
header("Location:../../index.php?view=inc");
            exit();
        }