24 lines
413 B
PHP
24 lines
413 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Created by PhpStorm.
|
||
|
* User: REMI
|
||
|
* Date: 16/04/2019
|
||
|
* Time: 14:46
|
||
|
*/
|
||
|
|
||
|
|
||
|
function connexionBD(){
|
||
|
$host = "localhost";
|
||
|
$dbname = "projetWeb";
|
||
|
$user = "postgres";
|
||
|
$pass = "0000";
|
||
|
|
||
|
$db = pg_connect("host=$host port=5432 dbname=$dbname user=$user password=$pass");
|
||
|
|
||
|
if($db == false){
|
||
|
echo "Erreur lors de la connexion à la base de données.";
|
||
|
}
|
||
|
return $db;
|
||
|
}
|
||
|
|