course example
This commit is contained in:
20
init.php
Normal file
20
init.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
try {
|
||||
|
||||
$opt = [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_EMULATE_PREPARES => false
|
||||
];
|
||||
|
||||
$dsn = "pgsql:host=localhost;dbname=WebGIS;port=5432";
|
||||
$pdo = new PDO($dsn, 'postgres', '1a2b3c4d5e6f', $opt);
|
||||
|
||||
// Error-Message
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: ".$e->getMessage();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user