You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
620 B
36 lines
620 B
<?php // define our generic db call for use with pgsql
|
|
|
|
function connect($host, $dbname) {
|
|
global $port;
|
|
$link = pg_connect($host,$port,$dbname);
|
|
return($link);
|
|
}
|
|
|
|
function query($link, $query) {
|
|
$result = pg_exec($link, $query);
|
|
return($result);
|
|
}
|
|
|
|
function numrows($result) {
|
|
$count = pg_numrows($result);
|
|
return($count);
|
|
}
|
|
|
|
function fetch_object($result, $row) {
|
|
$data = pg_fetch_object($result, $row);
|
|
return($data);
|
|
}
|
|
|
|
function free_result($result) {
|
|
pg_freeresult($result);
|
|
}
|
|
|
|
function close($link) {
|
|
pg_close($link);
|
|
}
|
|
|
|
function errormessage($link) {
|
|
return(pg_errormessage($link));
|
|
}
|
|
|
|
?>
|