| Server IP : 159.223.102.202 / Your IP : 216.73.216.193 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/bottaingenieriaUep/htdocs/www.bottaingenieria.com.ar/clases/ |
Upload File : |
<?php
/**
* Description of conexion
*
* @author Hernan
*/
class Conexion // se declara una clase para hacer la conexion con la base de datos
{
var $con;
function __construct()
{
$conection['server']="localhost"; //host
$conection['user']="u412594408geniu"; // usuario
$conection['pass']="@ks:dW_dkjPx#lcpx3"; //password
$conection['base']="u412594408webbi"; //base de datos
// crea la conexion pasandole el servidor , usuario y clave
$conect= mysqli_connect($conection['server'],$conection['user'],$conection['pass']);
if ($conect) // si la conexion fue exitosa , selecciona la base
{
mysqli_select_db($conect,$conection['base']);
$this->con=$conect;
} else {
if (mysqli_connect_errno()) echo "Error - Failed to connect to MySQL: " . mysqli_connect_error();
}
}
function GetLink() // devuelve la conexion
{
return $this->con;
}
function Close() // cierra la conexion
{
mysqli_close($this->con);
}
function cleanQuery($string)
{
$string = mysqli_real_escape_string($this->con,$string);
return $string;
}
}
?>