HomeHelpTrac

source: trunk/inc/db.inc.php @ 15338

Revision 15338, 2.5 KB checked in by Anton Lesnikov, 11 months ago (diff)

Get rid of $site and $GLOBALSsite? global variables.

Line 
1<?php
2/**
3 * @package     Dolphin Core
4 * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
5 * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
6 */
7defined('BX_DOL') or die('hack attempt');
8
9bx_import('BxDolDb');
10
11function db_list_tables( $error_checking = true ) {
12    BxDolDb::getInstance()->setErrorChecking ($error_checking);
13    return BxDolDb::getInstance()->listTables();
14}
15
16function db_get_encoding ( $error_checking = true ) {
17    BxDolDb::getInstance()->setErrorChecking ($error_checking);
18    return BxDolDb::getInstance()->getEncoding();
19}
20
21function db_res( $query, $error_checking = true ) {
22    BxDolDb::getInstance()->setErrorChecking ($error_checking);
23    return BxDolDb::getInstance()->res($query);
24}
25
26function db_last_id() {
27    return BxDolDb::getInstance()->lastId();
28}
29
30function db_affected_rows() {
31    return BxDolDb::getInstance()->getAffectedRows();
32}
33
34function db_res_assoc_arr( $query, $error_checking = true ) {
35    BxDolDb::getInstance()->setErrorChecking ($error_checking);
36    return BxDolDb::getInstance()->getAll($query);
37}
38
39function db_arr( $query, $error_checking = true ) {
40    BxDolDb::getInstance()->setErrorChecking ($error_checking);
41    return BxDolDb::getInstance()->getRow($query, MYSQL_BOTH);
42}
43
44function db_assoc_arr( $query, $error_checking = true ) {
45    BxDolDb::getInstance()->setErrorChecking ($error_checking);
46    return BxDolDb::getInstance()->getRow($query);
47}
48
49function db_value( $query, $error_checking = true, $index = 0 ) {
50    BxDolDb::getInstance()->setErrorChecking ($error_checking);
51    return BxDolDb::getInstance()->getOne($query, $index);
52}
53
54function fill_array( $res ) {
55    return BxDolDb::getInstance()->fillArray($res, MYSQL_BOTH);
56}
57
58function fill_assoc_array( $res ) {
59    return BxDolDb::getInstance()->fillArray($res, MYSQL_ASSOC);
60}
61
62function isParam( $param_name, $use_cache = true ) {
63    return BxDolDb::getInstance()->isParam($param_name, $use_cache);
64}
65
66function addParam($sName, $sValue, $iKateg, $sDesc, $sType) {
67    return BxDolDb::getInstance()->addParam($sName, $sValue, $iKateg, $sDesc, $sType);
68}
69
70function getParam( $param_name, $use_cache = true ) {
71    return BxDolDb::getInstance()->getParam($param_name, $use_cache);
72}
73
74function getParamDesc( $param_name ) {
75    return BxDolDb::getInstance()->getOne ("SELECT `desc` FROM `sys_options` WHERE `Name` = '$param_name'");
76}
77
78function setParam( $param_name, $param_val ) {
79    return BxDolDb::getInstance()->setParam($param_name, $param_val);
80}
81
Note: See TracBrowser for help on using the repository browser.