asXML();
die();
// Connect to the Database.
$host = (string) $applicationSettings->DatabaseServer;
$database = (string) $applicationSettings->DatabaseName;
$user = (string) $applicationSettings->DatabaseUser;
$password = (string) $applicationSettings->DatabasePassword;
try {
$connection = new PDO("mysql:host={$host};dbname={$database}", $user, $password);
} catch (PDOException | Exception $e) {
echo "Unable to connect to the database.
";
echo "Error is: {$e->getMessage()}";
exit();
}
// Create the view.
$connection->exec("drop view if exists {$view}");
try {
$connection->exec($SQL);
} catch (Exception $e) {
echo "Error creating view.
";
echo "Error is: {$e->getMessage()}";
exit();
}
if ($connection->errorCode() != 0) {
echo "Error creating view.
";
echo "
";
print_r($connection->errorInfo());
} else {
echo "View {$view} was created.";
}
?>