securite
This commit is contained in:
18
TP5/lib/common.php
Normal file
18
TP5/lib/common.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
function initDatabase() {
|
||||
$dir = dirname(__FILE__);
|
||||
try {
|
||||
$db = new PDO (
|
||||
'mysql:host=localhost;dbname=securite',
|
||||
'',
|
||||
'');
|
||||
//
|
||||
//$db = new PDO('sqlite:' . $dir .'/database.sq3');
|
||||
// $db = new PDO('mysql:host=localhost;dbname=Base', 'login', 'mdp');
|
||||
} catch (PDOException $e) {
|
||||
die('DB error: ' . $e->getMessage());
|
||||
}
|
||||
return $db;
|
||||
}
|
||||
|
Reference in New Issue
Block a user