PHP Classes

File: Example.php

Recommend this page to a friend!
  Packages of Muddathir Samir   PHP CRUD Library Trait   Example.php   Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP CRUD Library Trait
Manipulate database table records using a trait
Author: By
Last change:
Date: 9 months ago
Size: 513 bytes
 

Contents

Class file image Download

<?php session_start();
   
// this is an example of using curd trait
   
include 'conn.php'; // include your connection to database
   
   
$root = new root($conn);

   
$root->checkEmpty($_POST);
   

   
$error = $root->getErrors();

    if(empty(
$error)){
       
$success = $inc->saveWithoutId('tableName_here',$_POST);
       
header("Location:index.php?view=inc");
        exit();
    }else {
       
$_SESSION['errArr'] = $error;
       
header("Location:index.php?view=inc");
        exit();
    }