PHP Classes

File: DB_INFO.php

Recommend this page to a friend!
  Classes of Kevin Cadman   Authentication   DB_INFO.php   Download  
File: DB_INFO.php
Role: Configuration script
Content type: text/plain
Description: Database connection setup
Class: Authentication
A session and cookie based authentication class
Author: By
Last change:
Date: 21 years ago
Size: 743 bytes
 

Contents

Class file image Download
<?PHP
/*
This file is used for Database Setup.
Pretty self explanitary, replace the values below with your corresponding mySQL values.

Note!
The "table name" is defined in the Authentication.php class.
*/
   
require_once 'DB.php';
    
$username = "USERNAME"; // Put your username here
    
$password = "PASSWORD"; // Put your password here
    
$host = "HOST"; // Put the IP address or hostname of your mySQL server here.
    
$db_name = "DATABASE"; // Put your database name here.
    
$dsn = "mysql://$username:$password@$host/$db_name";
    
$db = DB::connect($dsn, true);
    
$db->setFetchMode(DB_FETCHMODE_OBJECT);
        if (
DB::isError($db)) {
            die (
$db->getMessage());
        }
    global
$db;
?>