Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- class db_mysql {
- var $link = null;
- var $recent_link = null;
- var $sql = '';
- var $query_count = 0;
- var $error = '';
- var $errorPath = '';
- var $errorStr = '';
- var $errorQuery = array( );
- var $show_errors = false;
- var $debug = 1;
- function db_mysql() {
- global $config_db_server;
- global $config_db_server_username;
- global $config_db_server_password;
- global $config_db_database;
- $password = str_replace( ( '' . '$' ), '$', $config_db_server_password );
- $this->link = @mysql_connect( $config_db_server, $config_db_server_username, $password );
- $this->errorQuery = array( );
- $this->error = '';
- $this->limit = '';
- $this->offset = '';
- $this->errorPath = '';
- if ($this->link) {
- if (@mysql_select_db( $config_db_database, $this->link )) {
- $this->recent_link = &$this->link;
- global $config_db_charset;
- global $config_db_collation;
- global $mysql_locale;
- global $mysql_names;
- if ($mysql_locale != '') {
- mysql_query( 'SET lc_time_names = \'' . $mysql_locale . '\'' );
- }
- if ($mysql_names != '') {
- mysql_query( '' . 'SET NAMES ' . $mysql_names );
- }
- return $this->link;
- }
- $this->errorPath = $this->getErrorPath( );
- $this->error = '' . 'Could not select database: ' . $config_db_database;
- return null;
- }
- $this->error = '' . 'Could not connect to server: ' . $config_db_server;
- $this->errorPath = $this->getErrorPath( );
- }
- function test() {
- return 1;
- }
- function geterror() {
- global $config_debug;
- $str = '<span>Database query error. </span>';
- if ($config_debug) {
- $str .= '<span>The error was: </span>' . $this->error;
- $str .= '<br><span>SQL query/queries : </span>' . $this->printErrorQuery( ) . '<span>Error path:</span> ' . $this->errorPath;
- }
- return $str;
- }
- function printerrorquery() {
- $result = '';
- foreach ($this->errorQuery as $str) {
- $result .= $str . '<br>';
- }
- return $result;
- }
- function setsql($sql) {
- $this->sql = $sql;
- }
- function getsql() {
- return $this->sql;
- }
- function query($sql = '') {
- if ($sql) {
- $this->sql = $sql;
- }
- if (!is_resource( $this->link )) {
- return false;
- }
- $this->recent_link = &$this->link;
- if (( 0 < $this->limit || 0 < $this->offset )) {
- $this->sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
- }
- $result = @mysql_query( $this->sql, $this->link );
- ++$this->query_count;
- if (!$result) {
- $this->error( );
- $this->errorPath = $this->getErrorPath( );
- return false;
- }
- return $result;
- }
- .............................................................
- .............................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement