Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/06/2012, 14:09
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Problema al utilizar query en pear db

Es muy raro, prueba el ejemplo que ponen en la documentación:
Código PHP:
Ver original
  1. <?php
  2. // Create a valid DB object named $db
  3. // at the beginning of your program...
  4. require_once 'DB.php';
  5.  
  6. $db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
  7. if (PEAR::isError($db)) {
  8.     die($db->getMessage());
  9. }
  10.  
  11. // Proceed with a query...
  12. $res =& $db->query('SELECT * FROM clients');
  13.  
  14. // Always check that result is not an error
  15. if (PEAR::isError($res)) {
  16.     die($res->getMessage());
  17. }

Ahora ya no es recomendado usar PearDB, yo te recomendaría que utilizaras PDO, es mucho más rápido y tiene soporte completo para PHP5.

Saludos.