Skip to content

Commit a568be8

Browse files
committed
Declarar estandar caracteres por seguridad
1 parent 002518d commit a568be8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config/db.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ public function getConnection()
1313
$this->conn = null;
1414
try {
1515
$this->conn = new mysqli($this->host, $this->username, $this->password, $this->db_name);
16+
17+
// Establecer el conjunto de caracteres.
18+
$this->conn->set_charset("utf8mb4");
19+
1620
} catch (Exception $exception) {
17-
echo "Connection error: " . $exception->getMessage();
21+
echo "Error de conexión: " . $exception->getMessage();
1822
}
1923
return $this->conn;
2024
}
21-
}
25+
}

0 commit comments

Comments
 (0)