Hola a todos!
Me estoy iniciando en este mundo y estoy haciendo pruebas y tal. Al subir la web al hosting me da este error:
Warning: PDO::__construct() expects parameter 4 to be array, string given in /home/a6020842/public_html/registrar.php on line 13
Tengo mi config.php asi:
Código:
<?php
define( "DB_DSN", "mysql:dbname=a6020842_colosal" );
define( "DB_USERNAME", "a6020842_colosal" );
define( "DB_PASSWORD", "xxxxxxxx" );
define( "DB_HOST", "mysql5.000webhost.com" );
define( "PAGE_SIZE", 5 );
define( "TBL_MEMBERS", "members" );
define( "TBL_ACCESS_LOG", "accessLog" );
?>
y mi registrar.php asi, la que está en rojo es la linea del fallo.
Código:
<?php
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
include ("config.php");
try {
$conn = new PDO (DB_DSN, DB_USERNAME, DB_PASSWORD, DB_HOST);
$conn->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Fallo de conexion: " . $e->getMessage();
}
Muchas Gracias de antemano.