Example #1
0
 static function conectar()
 {
     if (self::$db = new mysqli("mysql.hostinger.mx", "u899649304_abarr", "patoabarrotes", "u899649304_abarr")) {
         return "Conexión correcta";
     } else {
         die("No hay conexión a la base de gatos");
         header('Location: error-conexion.php');
         return 0;
     }
 }
Example #2
0
 static function conectar()
 {
     //if(self::$db = new mysqli("localhost","root","pato2000","abarrotes")){
     if (self::$db = new mysqli($GLOBALS['env']['db_host'], $GLOBALS['env']['db_user'], $GLOBALS['env']['db_pass'], $GLOBALS['env']['db_base'])) {
         self::$db->query('SET time_zone = "-06:00"');
         mysqli_set_charset(self::$db, "latin1");
         // mysql_query("SET NAMES 'utf8'");
         return "Conexión correcta";
     } else {
         die("No hay conexión a la base de gatos");
         header('Location: error-conexion.php');
         return 0;
     }
 }
Example #3
0
function salir()
{
    SQLconexion::desconectar();
    die('No se tiene los permisos para realizar esta acción!');
}