Inheritance diagram for Db:

Definition at line 37 of file db.php.
Public Member Functions | ||||
| __construct () | ||||
| Establishes database connection. | ||||
| query ($sql) | ||||
| ||||
|
|
Establishes database connection. All data has to be in UTF-8.
Definition at line 44 of file db.php. References query(). 00044 {
00045 global $mysql_host, $mysql_username, $mysql_password, $mysql_dbname;
00046 parent::__construct($mysql_host, $mysql_username, $mysql_password, $mysql_dbname);
00047 if (mysqli_connect_errno()):
00048 throw new Exception(sprintf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error()));
00049 endif;
00050 parent::query("SET NAMES 'utf8'"); // we work in UTF-8
00051 }
|
|
|
Definition at line 57 of file db.php. References query(). 00057 {
00058 $result = parent::query($sql);
00059 if (!$result):
00060 throw new Exception(sprintf("Error in query %s. Error message: %s\n", $sql, $this->error));
00061 endif;
00062 return $result;
00063 }
|
1.4.2