Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/08/2015, 15:43
jaloayzac
 
Fecha de Ingreso: julio-2015
Mensajes: 16
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: Error al llamar funcion() en php

Esta es la funcion

Código PHP:
Ver original
  1. <?php
  2.  
  3. /*<!-- Funcion para conectar a la Base de Datos -->*/
  4. function db_connect()
  5. {
  6.     global $conexion;
  7.     $hostname = 'localhost';
  8.     $database = 'u676825869_pacif';
  9.     $username = 'root';
  10.     $password = '*******';
  11.     try {
  12.         $conexion = new PDO('mysql:host='.$hostname.';dbname='.$database,$username,$password);
  13.     } catch (PDOException $e) {
  14.         print "¡Error!: ".$e->getMessage()."";
  15.         die();
  16.     }
  17.     date_default_timezone_set('America/Lima');
  18.     setlocale(LC_MONETARY, 'es_PE');
  19. }
  20. ?>