Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost';
- $db = 'dtm';
- $user = 'postgres';
- $pass = 'master';
- $conn = null;
- try {
- $conn = new PDO("pgsql:host=$host dbname=$db", $user, $pass);
- } catch (PDOException $pe) {
- die('Erro abrindo bd: ' . $pe->getMessage());
- }
- function certificaQueryOk(PDOStatement $q) {
- global $conn;
- if (!$q) {
- $ei = $conn->errorInfo();
- die('Não pode executar query: ' . $ei[2]);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement