I'm starting to program in PHP and MySql and trying to connect the database with the PDO method marks me the error, This is my code:
else {
try {
$conexion = new PDO('mysql:host=localhost;dbname=registro_prueba1', 'root', 'contraseña', '');
} catch (PDOException $e) {
echo "Error " . $e->getMessage();
The error that is presented is the following:
Warning: PDO :: __ construct () expects parameter 4 to be array, string given in
Does anyone know how to do it?