PHP Classes

File: config.php

Recommend this page to a friend!
  Classes of Mehmet Kidiman   Developbat PHP CRUD   config.php   Download  
File: config.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Developbat PHP CRUD
Show pages to manage table records using Bootstrap
Author: By
Last change:
Date: 3 years ago
Size: 1,374 bytes
 

Contents

Class file image Download
<?php
ob_start
();
session_start();

// DB Config
$db_host = "localhost";
$db_username = "db_username";
$db_password = "db_password";
$db_name = "database_name";

try {
   
$connect = new PDO('mysql:host=' . $db_host . ';dbname=' . $db_name, $db_username, $db_password);
   
$connect->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES utf8');
   
$connect->exec('set names utf8');
} catch (
PDOException $ex) {
    die(
"Unable Connect To DataBase");
}
/// DB Tables Showing Config
 
$showTables = array(); // show all tables
/*
$showTables = [
    ['depo'],
    ['kontak']

]; //show only in array tables
*/

// example configuration for relation
// Table Relation
$relationTable = [
   
'depo' => [
        
'changedRow' => "super_id",
        
'secondTable' => "members",
        
'secondRow' => "memberID",
        
'findRow' =>"username"
       
],
   
'gelir_gider' => [
       
'changedRow' => "uid",
       
'secondTable' => "members",
       
'secondRow' => "memberID",
       
'findRow' =>"username"
   
]


];

// Change Table Column Names
$customColumnsNames = [
   
'depo' => [
        [
"colon0" => "1"],
        [
"colon1" => "2"],
        [
"colon2" => "3"],
 ]
];
// Change Table Names
/*$customColumnsNames = [
        ["depo" => "Depo"],
        ["gelir_gider" => "Gider"],
        ["kontak" => "Kontak"],

];*/
$imageColums = [
   
'depo' => "images"
];
?>