aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/includes/sql.class.php
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-29 15:46:26 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-29 15:46:26 -0500
commit4bc1e32a79c0928a079113c51f9cf9fcaf525a63 (patch)
tree00312c30100c6947859324c39d80b7fcafaf92f1 /modules/rudi/includes/sql.class.php
parentad6ba256efd1a65fb1bb3951ae6b17b1593205b7 (diff)
downloadbayonetcms-4bc1e32a79c0928a079113c51f9cf9fcaf525a63.tar.gz
(OC) I cut down the calendar queries to just one which seems to work out a lot better.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@409 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/rudi/includes/sql.class.php')
-rw-r--r--modules/rudi/includes/sql.class.php90
1 files changed, 90 insertions, 0 deletions
diff --git a/modules/rudi/includes/sql.class.php b/modules/rudi/includes/sql.class.php
new file mode 100644
index 0000000..4066684
--- /dev/null
+++ b/modules/rudi/includes/sql.class.php
@@ -0,0 +1,90 @@
+<?php
+
+static $db_queries = 0;
+static $db_connections = 0;
+static $db_frees = 0;
+static $db_fetches = 0;
+
+class RUDI_SQL
+{
+ protected $hostname;
+ public function Connect($hostname, $username, $passwd)
+ {
+ global $db_connections;
+ ++$db_connections;
+
+ $this->hostname = $hostname;
+
+ decho("Connecting ('$hostname')");
+ return mysql_connect($hostname, $username, $passwd);
+ }
+
+ public function Disconnect($link)
+ {
+ decho("Disconnecting ('$link' from '$this->hostname')");
+ //return mysql_close($link);
+ }
+
+ public function Select_db($db)
+ {
+ decho("Selecting database ('$db')");
+ return mysql_select_db($db);
+ }
+
+ public function Query($str)
+ {
+ global $db_queries;
+ ++$db_queries;
+ //decho("Querying ('$str')");
+ return mysql_query($str);
+ }
+
+ public function Free($result)
+ {
+ global $db_frees;
+ ++$db_frees;
+ //decho("Freeing ('$result')");
+ return mysql_free_result($result);
+ }
+
+ public function Fetch($result)
+ {
+ //decho("Fetching ('$result')");
+ return $this->FetchArray($result);
+ }
+
+ public function FetchArray($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ /* Alias Fetch() prefered, so no decho information */
+ return mysql_fetch_array($result,MYSQL_ASSOC);
+ }
+
+ public function FetchObject($result,$class)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ //decho("Fetching ('$result')");
+ return mysql_fetch_object($result,$class);
+ }
+
+ public function FetchAssoc($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ return mysql_fetch_assoc($result);
+ }
+
+ public function FetchRow($result)
+ {
+ return mysql_fetch_row($result);
+ }
+
+ public function Rows($result)
+ {
+ return mysql_num_rows($result);
+ }
+}
+
+?> \ No newline at end of file