Ejemplo n.º 1
0
<?php

include "../conf/main.php";
include "../libs/functions.php";
include "../model/databases.php";
include "sqls.php";
$postgisdb = $_REQUEST['db'];
$conn = new postgis();
try {
    $conn->connect();
} catch (Exception $e) {
    echo $e->getMessage() . "\n";
    die;
}
$conn->begin();
//Try to drop schema
/*
$result = $conn->execQuery("DROP SCHEMA settings CASCADE","PDO","transaction");
if (!$conn->PDOerror[0]) {
	echo "Schema dropped<br/>";
}
else {
	echo "Something went wrong; {$conn->PDOerror[0]}";
	$conn->rollback();
}
*/
//Try to create schema
$result = $conn->execQuery($sqls['schema'], "PDO", "transaction");
if (!$conn->PDOerror[0]) {
    echo "Schema created<br/>";
} else {