1 | <?php
|
---|
2 |
|
---|
3 | /***************************************************************************
|
---|
4 | * Dolphin Smart Community Builder
|
---|
5 | * -----------------
|
---|
6 | * begin : Mon Mar 23 2006
|
---|
7 | * copyright : (C) 2006 BoonEx Group
|
---|
8 | * website : http://www.boonex.com/
|
---|
9 | * This file is part of Dolphin - Smart Community Builder
|
---|
10 | *
|
---|
11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
|
---|
12 | * http://creativecommons.org/licenses/by/3.0/
|
---|
13 | *
|
---|
14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
---|
15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
16 | * See the Creative Commons Attribution 3.0 License for more details.
|
---|
17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
|
---|
18 | * see license.txt file; if not, write to marketing@boonex.com
|
---|
19 | ***************************************************************************/
|
---|
20 |
|
---|
21 | require_once("header.inc.php");
|
---|
22 | require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
|
---|
23 | require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php' );
|
---|
24 |
|
---|
25 | $GLOBALS['MySQL'] = new BxDolDb();
|
---|
26 |
|
---|
27 | $site['title'] = getParam('site_title');
|
---|
28 | $site['email'] = getParam('site_email');
|
---|
29 | $site['email_notify'] = getParam('site_email_notify');
|
---|
30 |
|
---|
31 | function db_list_tables( $error_checking = true ) {
|
---|
32 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
33 | return $GLOBALS['MySQL']->listTables();
|
---|
34 | }
|
---|
35 |
|
---|
36 | function db_get_encoding ( $error_checking = true ) {
|
---|
37 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
38 | return $GLOBALS['MySQL']->getEncoding();
|
---|
39 | }
|
---|
40 |
|
---|
41 | function db_res( $query, $error_checking = true ) {
|
---|
42 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
43 | return $GLOBALS['MySQL']->res($query);
|
---|
44 | }
|
---|
45 |
|
---|
46 | function db_last_id() {
|
---|
47 | return $GLOBALS['MySQL']->lastId();
|
---|
48 | }
|
---|
49 |
|
---|
50 | function db_affected_rows() {
|
---|
51 | return $GLOBALS['MySQL']->getAffectedRows();
|
---|
52 | }
|
---|
53 |
|
---|
54 | function db_res_assoc_arr( $query, $error_checking = true ) {
|
---|
55 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
56 | return $GLOBALS['MySQL']->getAll($query);
|
---|
57 | }
|
---|
58 |
|
---|
59 | function db_arr( $query, $error_checking = true ) {
|
---|
60 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
61 | return $GLOBALS['MySQL']->getRow($query, MYSQL_BOTH);
|
---|
62 | }
|
---|
63 |
|
---|
64 | function db_assoc_arr( $query, $error_checking = true ) {
|
---|
65 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
66 | return $GLOBALS['MySQL']->getRow($query);
|
---|
67 | }
|
---|
68 |
|
---|
69 | function db_value( $query, $error_checking = true, $index = 0 ) {
|
---|
70 | $GLOBALS['MySQL']->setErrorChecking ($error_checking);
|
---|
71 | return $GLOBALS['MySQL']->getOne($query, $index);
|
---|
72 | }
|
---|
73 |
|
---|
74 | function fill_array( $res ) {
|
---|
75 | return $GLOBALS['MySQL']->fillArray($res, MYSQL_BOTH);
|
---|
76 | }
|
---|
77 |
|
---|
78 | function fill_assoc_array( $res ) {
|
---|
79 | return $GLOBALS['MySQL']->fillArray($res, MYSQL_ASSOC);
|
---|
80 | }
|
---|
81 |
|
---|
82 | function getParam( $param_name, $use_cache = true ) {
|
---|
83 | return $GLOBALS['MySQL']->getParam($param_name, $use_cache);
|
---|
84 | }
|
---|
85 |
|
---|
86 | function getParamDesc( $param_name ) {
|
---|
87 | return $GLOBALS['MySQL']->getOne ("SELECT `desc` FROM `sys_options` WHERE `Name` = '$param_name'");
|
---|
88 | }
|
---|
89 |
|
---|
90 | function setParam( $param_name, $param_val ) {
|
---|
91 | return $GLOBALS['MySQL']->setParam($param_name, $param_val);
|
---|
92 | }
|
---|
93 |
|
---|
94 | ?> |
---|