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 40 41 42 43
|
class MySQL {
var $serveur;
var $utilisateur;
var $password;
var $bd;
var $connection_SQL;
var $resultat;
var $connection_ok;
var $erreur;
var $debug;
var $op_OK;
//contructeur
function MySQL($serveur, $utilisateur, $password, $bd, $debug){
//init de mes variable
$this->Connection();
}
function Connection(){
if ($this->connection_ok == 0){
$this->connection_SQL = @mysql_connect($this->serveur,
$this->utilisateur,
$this->password
);
echo $this->connection_SQL;
if (! $this->connection_SQL){
$this->Mysql_erreur();
}
else {
$this->Select_bd();
}
}
}
function Mysql_erreur(){
if ($this->debug){
$this->erreur = @mysql_error($this->connection_SQL);
}
$this->op_OK = false;
}
} |
Partager