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
|
//variable :
private $_select;
private $_tablename;
private $_champsSelection = array(); //'id', 'nom' ...
private $_where = array() ; //
//Fonctions
public function __construct($tablename)
{
$this->setTableName($tablename);
}
public function setTableName($table) { $this->_tablename = $table };
where($champs, $condition) {
$this->_where[] =" WHERE $champs = $condition ";
}
public function fetchall() {
$this->_select = "SELECT (ici tu ajoutes tes $this->_champsSelection) From $this->_tablename (ici tu affiches les wheres) .. . . .
//query.... etc
; // retourne le résultat sous forme de tableau
}
public function fetchRow(){};
public function join()...
..
} |
Partager