source: trunk/inc/db.inc.php

Last change on this file was 2, checked in by george, 14 years ago
  • Přidáno: Trunk revize 13719.
File size: 3.2 KB
Line 
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
21require_once("header.inc.php");
22require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
23require_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
31function db_list_tables( $error_checking = true ) {
32 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
33 return $GLOBALS['MySQL']->listTables();
34}
35
36function db_get_encoding ( $error_checking = true ) {
37 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
38 return $GLOBALS['MySQL']->getEncoding();
39}
40
41function db_res( $query, $error_checking = true ) {
42 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
43 return $GLOBALS['MySQL']->res($query);
44}
45
46function db_last_id() {
47 return $GLOBALS['MySQL']->lastId();
48}
49
50function db_affected_rows() {
51 return $GLOBALS['MySQL']->getAffectedRows();
52}
53
54function db_res_assoc_arr( $query, $error_checking = true ) {
55 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
56 return $GLOBALS['MySQL']->getAll($query);
57}
58
59function db_arr( $query, $error_checking = true ) {
60 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
61 return $GLOBALS['MySQL']->getRow($query, MYSQL_BOTH);
62}
63
64function db_assoc_arr( $query, $error_checking = true ) {
65 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
66 return $GLOBALS['MySQL']->getRow($query);
67}
68
69function db_value( $query, $error_checking = true, $index = 0 ) {
70 $GLOBALS['MySQL']->setErrorChecking ($error_checking);
71 return $GLOBALS['MySQL']->getOne($query, $index);
72}
73
74function fill_array( $res ) {
75 return $GLOBALS['MySQL']->fillArray($res, MYSQL_BOTH);
76}
77
78function fill_assoc_array( $res ) {
79 return $GLOBALS['MySQL']->fillArray($res, MYSQL_ASSOC);
80}
81
82function getParam( $param_name, $use_cache = true ) {
83 return $GLOBALS['MySQL']->getParam($param_name, $use_cache);
84}
85
86function getParamDesc( $param_name ) {
87 return $GLOBALS['MySQL']->getOne ("SELECT `desc` FROM `sys_options` WHERE `Name` = '$param_name'");
88}
89
90function setParam( $param_name, $param_val ) {
91 return $GLOBALS['MySQL']->setParam($param_name, $param_val);
92}
93
94?>
Note: See TracBrowser for help on using the repository browser.