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:
Date: 2 months ago
Size: 804 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';

   
$inc->checkEmpty($_POST);
   
$inc->checkName($_POST['insurance_type']);

   
$error = $inc->getErrors();

    if(empty(
$error)){
       
$success = $inc->save('insurance_types',$_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();
        }
    }else {
       
$_SESSION['errArr'] = $error;
       
header("Location:../../index.php?view=inc");
        exit();
    }


For more information send a message to info at phpclasses dot org.