25 lines
541 B
PHP
25 lines
541 B
PHP
<?php
|
|
$db_connection="pgsql:host=94.247.128.218;dbname=monitoring_new;";
|
|
$db_login="postgres";
|
|
$db_password="y7HMHi0ATxx1VC3UU5WG";
|
|
|
|
$Schema="main.";
|
|
|
|
function connectToDB()
|
|
{
|
|
global $db_connection,$db_login,$db_password;
|
|
$db = null;
|
|
try
|
|
{
|
|
$db = new PDO($db_connection, $db_login, $db_password);
|
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
} catch (Exception $ex)
|
|
{
|
|
print $ex->getMessage();
|
|
error_log($ex->getMessage());
|
|
}
|
|
return $db;
|
|
}
|
|
|
|
|