Olive Branch MS Chamber of Commerce (circa Oct 1999)
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

36 lines
620 B

  1. <?php // define our generic db call for use with pgsql
  2. function connect($host, $dbname) {
  3. global $port;
  4. $link = pg_connect($host,$port,$dbname);
  5. return($link);
  6. }
  7. function query($link, $query) {
  8. $result = pg_exec($link, $query);
  9. return($result);
  10. }
  11. function numrows($result) {
  12. $count = pg_numrows($result);
  13. return($count);
  14. }
  15. function fetch_object($result, $row) {
  16. $data = pg_fetch_object($result, $row);
  17. return($data);
  18. }
  19. function free_result($result) {
  20. pg_freeresult($result);
  21. }
  22. function close($link) {
  23. pg_close($link);
  24. }
  25. function errormessage($link) {
  26. return(pg_errormessage($link));
  27. }
  28. ?>