Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database
- {
- private $host = "localhost:3306";
- private $db_name = "siiiecam_db_Agenda_Folio";
- private $username = "siiiecam_admin";
- private $password = "*********";
- private $conn;
- //metodo de conexion
- public function getConnection(){
- $this->conn = null;
- try {
- $this->conn = new PDO("mysql:host=".$this->host.";dbname=".$this->db_name,$this->username,$this->password);
- $this->conn->exec("set names utf8");
- } catch (PDOException $exception) {
- echo "Error de conexion: ".$exception->getMessage();
- }
- return $this->conn;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment