1
0
Fork 0
gnuviechadmin-historic/php/tools.php
Jan Dittberner 4c553504b2 basic setup and login mechanisms are done
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@23 a67ec6bc-e5d5-0310-a910-815c51eb3124
2003-11-23 20:44:06 +00:00

33 lines
No EOL
685 B
PHP

<?php
require("../config.php");
function db_open() {
global $config;
$dbh = pg_connect("dbname=".$config["db_name"].
" host=".$config["db_host"].
" user=".$config["db_user"].
" password=".$config["db_pass"])
or die("Couldn't connect to database!");
return $dbh;
}
function db_exec($dbh, $query) {
pg_exec($dbh, $query)
or die("Couldn't execute query!");
}
function db_close($dbh) {
pg_close($dbh)
or die("Couldn't close database connection!");
}
function db_query($dbh, $query) {
$result = pg_query($dbh, $query)
or die("Couldn't query database!");
return $result;
}
function db_num_rows($result) {
return pg_num_rows($result);
}