summaryrefslogtreecommitdiff
path: root/database.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-06-11 13:28:26 +0000
committerDries Buytaert <dries@buytaert.net>2000-06-11 13:28:26 +0000
commit130cbb719866dcbb5a704902cac989a380748494 (patch)
treef86d23fb7f5a8ccf8b2693bfb566b488cf9217f7 /database.inc
parentc8b214483347305966e1ffc1c913bcda991fbeb7 (diff)
downloadbrdo-130cbb719866dcbb5a704902cac989a380748494.tar.gz
brdo-130cbb719866dcbb5a704902cac989a380748494.tar.bz2
Updates:
* Streamlined the database abstraction layer a bit (it's not much yet) and integrated it in most of the functions of `functions.inc'.
Diffstat (limited to 'database.inc')
-rw-r--r--database.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/database.inc b/database.inc
index 52a436202..c91e48cea 100644
--- a/database.inc
+++ b/database.inc
@@ -1,9 +1,21 @@
<?
+/*
+ * These functions build the foundation for accessing the database:
+ * it is a general database abstraction layer suitable for several
+ * databases. Currently, the only supported database is MySQL but
+ * it should be straightforward to port it to any other database:
+ * just adjust the handlers to your needs.
+ */
+
+///////////////////////////////////////////////////////////////////////////
+// NOTE: these functions are under construction and in no way finilized! //
+///////////////////////////////////////////////////////////////////////////
function db_connect() {
include "config.inc";
mysql_pconnect($dbhost, $dbuname, $dbpass) or die(mysql_Error());
mysql_select_db("$dbname") or die ("Unable to select database");
+ // Note: we are using a persistent connection!
}
function db_query($query, $debug = false) {
@@ -23,4 +35,9 @@ function db_fetch_object($qid) {
if ($qid) return mysql_fetch_object($qid);
}
+#
+# Automatically connect to database:
+#
+db_connect();
+
?> \ No newline at end of file