namespace de fait hehe
This commit is contained in:
parent
6c21a5f1cb
commit
0638834933
23 changed files with 131 additions and 81 deletions
24
models/MotherModel.php
Normal file
24
models/MotherModel.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
namespace Models;
|
||||
|
||||
use \PDO;
|
||||
|
||||
class MotherModel {
|
||||
|
||||
protected $_db;
|
||||
|
||||
public function __construct(){
|
||||
try{
|
||||
$this->_db = new PDO(
|
||||
"mysql:host=localhost;dbname=projet_folliow",
|
||||
"projet_user",
|
||||
"F0lliowRules!",
|
||||
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC)
|
||||
);
|
||||
$this->_db->exec("SET CHARACTER SET utf8");
|
||||
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch(PDOException$e) {
|
||||
echo "Échec : " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue