| 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 | */ |
|---|
| 7 | defined('BX_DOL') or die('hack attempt'); |
|---|
| 8 | |
|---|
| 9 | bx_import('BxDolDb'); |
|---|
| 10 | |
|---|
| 11 | function db_list_tables( $error_checking = true ) { |
|---|
| 12 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 13 | return BxDolDb::getInstance()->listTables(); |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | function db_get_encoding ( $error_checking = true ) { |
|---|
| 17 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 18 | return BxDolDb::getInstance()->getEncoding(); |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | function db_res( $query, $error_checking = true ) { |
|---|
| 22 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 23 | return BxDolDb::getInstance()->res($query); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | function db_last_id() { |
|---|
| 27 | return BxDolDb::getInstance()->lastId(); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | function db_affected_rows() { |
|---|
| 31 | return BxDolDb::getInstance()->getAffectedRows(); |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | function db_res_assoc_arr( $query, $error_checking = true ) { |
|---|
| 35 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 36 | return BxDolDb::getInstance()->getAll($query); |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | function db_arr( $query, $error_checking = true ) { |
|---|
| 40 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 41 | return BxDolDb::getInstance()->getRow($query, MYSQL_BOTH); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | function db_assoc_arr( $query, $error_checking = true ) { |
|---|
| 45 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 46 | return BxDolDb::getInstance()->getRow($query); |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | function db_value( $query, $error_checking = true, $index = 0 ) { |
|---|
| 50 | BxDolDb::getInstance()->setErrorChecking ($error_checking); |
|---|
| 51 | return BxDolDb::getInstance()->getOne($query, $index); |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | function fill_array( $res ) { |
|---|
| 55 | return BxDolDb::getInstance()->fillArray($res, MYSQL_BOTH); |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | function fill_assoc_array( $res ) { |
|---|
| 59 | return BxDolDb::getInstance()->fillArray($res, MYSQL_ASSOC); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | function isParam( $param_name, $use_cache = true ) { |
|---|
| 63 | return BxDolDb::getInstance()->isParam($param_name, $use_cache); |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | function addParam($sName, $sValue, $iKateg, $sDesc, $sType) { |
|---|
| 67 | return BxDolDb::getInstance()->addParam($sName, $sValue, $iKateg, $sDesc, $sType); |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | function getParam( $param_name, $use_cache = true ) { |
|---|
| 71 | return BxDolDb::getInstance()->getParam($param_name, $use_cache); |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | function getParamDesc( $param_name ) { |
|---|
| 75 | return BxDolDb::getInstance()->getOne ("SELECT `desc` FROM `sys_options` WHERE `Name` = '$param_name'"); |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | function setParam( $param_name, $param_val ) { |
|---|
| 79 | return BxDolDb::getInstance()->setParam($param_name, $param_val); |
|---|
| 80 | } |
|---|
| 81 | |
|---|