PHP Classes

File: app/database/install.php

Recommend this page to a friend!
  Classes of Ali YILMAZ   PHP PhoneBook   app/database/install.php   Download  
File: app/database/install.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP PhoneBook
Phone book manager application based on MVC
Author: By
Last change:
Date: 3 years ago
Size: 1,082 bytes
 

Contents

Class file image Download
<?php

$tblname
= 'phonebook';

if(!
$this->is_db($this->dbname)){
   
$this->dbCreate($this->dbname);
   
$this->redirect();
}
if(!
$this->is_table($tblname)){

   
$options = array(
       
'id:increments',
       
'name',
       
'phone',
       
'email',
       
'created_at',
       
'updated_at'
   
);

   
$this->tableCreate($tblname, $options);

   
$rows = array(
        array(
           
'name' => 'John Doe 1',
           
'phone' => '05554443322',
           
'email' => 'johndoe1@gmail.com',
           
'created_at' => $this->timestamp
       
),
        array(
           
'name' => 'John Doe 2',
           
'phone' => '05553332211',
           
'email' => 'johndoe2@gmail.com',
           
'created_at' => $this->timestamp
       
),
        array(
           
'name' => 'John Doe 3',
           
'phone' => '05556665544',
           
'email' => 'johndoe3@gmail.com',
           
'created_at' => $this->timestamp
       
)
    );

   
$this->insert($tblname, $rows);
}
?>