diff options
author | Othmar Gsenger <otti@ffgraz.net> | 2013-11-12 18:24:00 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@ffgraz.net> | 2013-11-12 18:24:00 +0000 |
commit | a47c4eecff79c1d57650b46c437b628d873705b2 (patch) | |
tree | 9d53fe963419ce8965fe237be47784c1afd84510 /db.class.php | |
parent | f6be9edd401664d95e60ae3c81aeaf36723ba891 (diff) |
bisher uncommitete aenderungen am www.ffgraz.net (nicht von mir)
Diffstat (limited to 'db.class.php')
-rw-r--r-- | db.class.php | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/db.class.php b/db.class.php index 28dba49..0921bc8 100644 --- a/db.class.php +++ b/db.class.php @@ -1,47 +1,47 @@ -<?php
-class DB {
-var $user, $pass, $host, $dbname;
-var $db;
-var $res;
-
-function DB($user, $pass, $host, $dbname) {
- $this->user = $user;
- $this->pass = $pass;
- $this->host = $host;
- $this->dbname = $dbname;
- $this->connect();
-}
-
-function connect() {
- $this->db = mysql_connect($this->host, $this->user, $this->pass)
- or $this->error("Verbindungsaufbau fehlgeschlagen");
- mysql_select_db($this->dbname);
-}
-
-function error($msg) {
- die($msg . ": " . @mysql_error());
-}
-
-function query($query) {
- $this->res = mysql_query($query, $this->db)
- or $this->error("Fehler bei Datenbankanfrage");
-}
-
-function escape_string($string) {
- return mysql_real_escape_string($string, $this->db);
-}
-
-function numObjects() {
- return mysql_num_rows($this->res);
-}
-
-function getNextObject() {
- if (!$this->res) {
- return;
- }
- return mysql_fetch_object($this->res);
- }
-}
-
-
-?>
+<?php +class DB { +var $user, $pass, $host, $dbname; +var $db; +var $res; + +function DB($user, $pass, $host, $dbname) { + $this->user = $user; + $this->pass = $pass; + $this->host = $host; + $this->dbname = $dbname; + $this->connect(); +} + +function connect() { + $this->db = mysql_connect($this->host, $this->user, $this->pass) + or $this->error("Verbindungsaufbau fehlgeschlagen"); + mysql_select_db($this->dbname); +} + +function error($msg) { + die($msg . ": " . @mysql_error()); +} + +function query($query) { + $this->res = mysql_query($query, $this->db) + or $this->error("Fehler bei Datenbankanfrage"); +} + +function escape_string($string) { + return mysql_real_escape_string($string, $this->db); +} + +function numObjects() { + return mysql_num_rows($this->res); +} + +function getNextObject() { + if (!$this->res) { + return; + } + return mysql_fetch_object($this->res); + } +} + + +?> |