Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -> Membre.class.php
- <?php
- // reste de la class ...
- require_once('DB.class.php');
- $this->DB = new DB();
- $this->DB->query("INSERT INTO membres (id, nom, prenom, pw, rank, rank_name, mail, location, actif, birthday, lastvisit, regts) VALUES ('', '".$r_arr['nom']."', '".$r_arr['prenom']."', '".$r_arr['pw']."', '".$r_arr['rank']."', '".$r_arr['rank_name']."', '".$r_arr['mail']."', '".$r_arr['location']."', '".$r_arr['actif']."', '".$r_arr['birthday']."', '".$r_arr['lastvisit']."', '".$r_arr['regts']."'");
- ?>
- -> DB.class.php
- <?
- public function __construct(){
- require_once('config.inc.php');
- $this->host = $cfg['db']['host'];
- $this->user = $cfg['db']['user'];
- $this->pass = $cfg['db']['pass'];
- $this->name = $cfg['db']['name'];
- unset($cfg);
- $this->link = mysql_connect($this->host, $this->user, $this->pass);
- if(!$this->link && $this->debug){
- throw new MySQLExeption('<strong>DB::connect :</strong> Une erreur est survenue lors de la connexion à la base de donn&ecute;es ...<br />');
- return false;
- }
- $msd = mysql_select_db($this->name,$this->link);
- if (!$msd && $this->debug){
- throw new MySQLExeption('<strong>DB::db_select :</strong> Une erreur est survenue lors de la selection de la base ...<br />');
- return false;
- }
- unset($msd);
- return true;
- }
- public function query($req){
- $res = mysql_query($req,$this->link);
- $this->nreq++;
- return $res;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement