-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.php
39 lines (33 loc) · 1.02 KB
/
configure.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
* @author Shahrukh Khan
* @website http://www.thesoftwareguy.in
* @facebbok https://www.facebook.com/Thesoftwareguy7
* @twitter https://twitter.com/thesoftwareguy7
* @googleplus https://plus.google.com/+thesoftwareguyIn
*/
// display all error except deprecated and notice
error_reporting( E_ALL & ~E_DEPRECATED & ~E_NOTICE );
// turn on output buffering
ob_start();
define('DB_DRIVER', 'mysql');
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASSWORD", "");
define("DB_DATABASE", "sampletest");
require_once("functions.php");
// basic options for PDO
$dboptions = array(
PDO::ATTR_PERSISTENT => FALSE,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
);
//connect with the server
try {
$DB = new PDO(DB_DRIVER . ':host=' . DB_HOST . ';dbname=' . DB_DATABASE, DB_USER, DB_PASSWORD, $dboptions);
} catch (Exception $ex) {
printErrorMessage($ex->getMessage());
die;
}
?>