PHP Classes

File: sample_addidtional.php

Recommend this page to a friend!
  Classes of Pawel Janisio   SDB simple MySQL class   sample_addidtional.php   Download  
File: sample_addidtional.php
Role: Example script
Content type: text/plain
Description: Another sample
Class: SDB simple MySQL class
Wrapper to access MySQL databases
Author: By
Last change: version 0.2.2
Date: 13 years ago
Size: 1,288 bytes
 

Contents

Class file image Download
<?php
 
/*
SimpleDB
by Pawel 'Pavlus' Janisio
License: GPL v3
Example file
*/

require_once('../mysql_driver.php'); //include class file

$DB = new DB_MYSQL('localhost','3306','root','password', 'mysql'); //connect to database (host, port, user, password, database)

//$DB = new DB_MYSQL('localhost','3306','root','password', 'mysql', 2); //connect to database with debug mode = 2


//$DB->createDB('forgotten', 'latin1'); //create database 'forgotten' with latin1 default charset
//echo '<br>';

$DB->optimizeDB(TRUE); //database optimization TRUE - to get output of optimized tables

//$DB->importDumpexec('/home/pavlus/public_html/class_database/samples/mysqldump.sql'); //import sql file REMEMBER to use global path!

//Functions displaying mysql server statistics and variables

echo $DB->dbVars();
echo
'<br>';

//Display various statistics

echo $DB->dbStatistics();
echo
'<br>';

//Queries syntax display

echo $DB->showSyntaxes();
echo
'<br>';

//Show debug level

echo 'Debug Level is now: '.$DB->showDebugLevel();
echo
'<br>';

//Locks tables db, event, func from WRITE access

if($DB->LockTableRead('db','bans','func'))
echo
'Tables locked from write';
echo
'<br>';


//unlocks all locked tables

$DB->Unlock();
?>