note 130034 added to class.pdo

From: Date: Mon, 17 Feb 2025 13:02:17 +0000
Subject: note 130034 added to class.pdo
Groups: php.notes 
Request: Send a blank email to php-notes+get-221858@lists.php.net to get a copy of this message
<?php include_once '_____'; //You need to include all the classes that you are going to work class DAO_class { public $conexion; public function __construct() { try{ $dsn = 'mysql:host=localhost; dbname = dabNAME; charset:utf8'; $user= 'root'; $password= null; $this->conexion = new PDO($dsn, $user, $password); $this->conexion->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $this->conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); }catch (PDOException $e){ echo 'ERROR: ' . $e->getMessage(); } } } ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 83.37.203.28) ---- Manual Page -- https://php.net/manual/en/class.pdo.php Edit -- https://main.php.net/note/edit/130034 Del: integrated -- https://main.php.net/note/delete/130034/integrated Del: useless -- https://main.php.net/note/delete/130034/useless Del: bad code -- https://main.php.net/note/delete/130034/bad+code Del: spam -- https://main.php.net/note/delete/130034/spam Del: non-english -- https://main.php.net/note/delete/130034/non-english Del: in docs -- https://main.php.net/note/delete/130034/in+docs Del: other reasons-- https://main.php.net/note/delete/130034 Reject -- https://main.php.net/note/reject/130034 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221858) next »