<?php
interface
Connected
{
public
function
__construct();
public
function
connect ();
public
function
error_mysql ();
public
function
db_selected ();
public
function
mysql_close ();
}
class
ConfigureMysql
implements
Connected{
var
$_link
;
var
$_Link_Cons
;
var
$_Error
;
var
$_DB
;
public
function
__construct() {
$this
->_Link_Cons =
$this
->connect();
return
$this
->_Link_Cons ;
}
public
function
connect () {
$this
->_link = @mysql_connect(
'localhost'
,
'Faizal'
,
'XXXXXXXXXXX'
,
'3306'
)
or
die
(
$this
->error_mysql ());
}
public
function
error_mysql () {
$this
->_Error =
"<h2> Masalah Pada Koneksi Ke Jalur Mysql </h2>"
;
}
public
function
db_selected () {
$this
->_DB = mysql_select_db(
'XXXXXXXX'
);
if
(
$this
->_DB != TRUE) {
return
$this
->error_mysql();
}
else
{
return
false ;
}
}
public
function
mysql_close () {
return
mysql_close(
$this
->connect());
}
}
class
LinkCon
extends
ConfigureMysql {
var
$_Con
;
var
$_Db
;
var
$_Error_Show
;
var
$_Close
;
public
function
Conf_Show_Mysql () {
$this
->_Con = parent::__construct();
}
public
function
DB_Selected () {
$this
->_Db =
$this
->DB_Selected();
return
$this
->_Db ;
}
public
function
_CloseMysql () {
$this
->_Close =
$this
->mysql_close();
return
$this
->_Close ;
}
public
function
Eroor_Show () {
$this
->_Error_Show =
$this
->error_mysql();;
return
true ;
}
}
?>