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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| <?php
require("connection.php");
class essai{
public $idFile;
public $file;
function getIdFile() {
return $this->idFile;
}
function setIdFile($idFile) {
$this->idFile = $idFile;
}
function getFile() {
return $this->file;
}
function setFile($file) {
$this->file = $file;
}
function enregistrer() {
$connection=new Connection();
$connection->connect();
mysql_select_db("cabinet");
$req=mysql_query('insert into essai
values("" , "'.$this->file.'")');
if(!$req) {
//throw new Insertion();
echo "eeeeeee";
exit();
}
echo "<br /> ok<br />" ;
}
function consulter() {
$connection=new Connection();
$connection->connect();
mysql_select_db("cabinet");
$req=mysql_query('SELECT * FROM essai');
$tab=array();
if(!$req)
{
echo "consulter nnnn"; //throw new select();
exit();
}
while($res=mysql_fetch_array($req)) {
$essai=new essai();
$essai->idFile=$res[0];
$essai->file=$res[1];
array_push($tab, $essai);
//return $examen;
}
return $tab;
}
}
?> |
Partager