Ver Mensaje Individual
  #7 (permalink)  
Antiguo 25/06/2012, 04:26
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Como crear metodo conexion pdo

Hay que leer la documentación, PDO::query retorna false si hay un error, y te sugiero que si estas trabajando con PDO actives las excepciones.

Código PHP:
Ver original
  1. $this->_dbh = new PDO($this->_dns, $this->_username, $this->_passwd, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)