Sha256: 8b47022568113ae107c9a89d276e52a83f5a2fd8f6b73f6ba6f0b380d0176088

Contents?: true

Size: 803 Bytes

Versions: 12

Compression:

Stored size: 803 Bytes

Contents


<?php
require_once('def.inc');
	function dbconnect() {
		try { 
			$string ="pgsql:host=".HOSTNAME.";port=".PORT.";dbname=".DBNAME;
			$dbh = NULL;
			$dbh = new PDO($string,USER,PASS);
			$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);;
			return $dbh;
		} catch (Exception $e) {
			echo "fail : " .$e->getMessage()." <BR>";
			ErrorResult($php_errormsg);
			return NULL;
		}
	}

	function trans_end($dbh,$trans) {
		try { 
			$stmt = $dbh->prepare($trans);
			$stmt->execute();
			print_r($stmt->fetch());
		} catch (Exception $e) {
			ErrorResult($php_errormsg);
		}
	}

	function ErrorResult($php_errormsg) {
		header('HTTP/1.0 402 SQL ERROR');
		require_once("errorhandler.inc");
		set_error_handler("userErrorHandler");
		trigger_error($php_errormsg, E_USER_ERROR);
		exit;
	}
?>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
prestogres-0.4.8 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.7 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.6 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.5 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.4 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.3 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.2 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.1 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.4.0 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.3.0 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.2.0 pgpool2/test/pdo-test/mod/database.inc
prestogres-0.1.0 pgpool2/test/pdo-test/mod/database.inc