PHP Classes

File: dbconnect.inc.php

Recommend this page to a friend!
  Classes of Marian VASILE   SQL Engine   dbconnect.inc.php   Download  
File: dbconnect.inc.php
Role: Configuration script
Content type: text/plain
Description: DB connection script - needs to be place in dbcontext folder
Class: SQL Engine
Execute common database access SQL queries
Author: By
Last change: Please create dbcontext folder and place dbconnect, sqlengine and logger scripts inside. Also create a log folder and set permissions to a+r.
Date: 18 years ago
Size: 324 bytes
 

Contents

Class file image Download
<?php

require('DB.php');
define("DB_ENGINE_MYSQL", 1);

global
$db; // make $db global to make it available to SQLEngine class
$dsn = "mysql://root:qwe123@localhost/sqlengine";
// $dsn = "oci8://user1:passss@sqlengine";
$db = DB::connect($dsn);
if (
DB::isError($db)) { die("Cannot connect to database."); }


?>