Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/01/2011, 09:56
Coplo
 
Fecha de Ingreso: octubre-2008
Mensajes: 155
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: ¿Como puedo hacer una lista enlazada con ajax?

<?php
class Conectar{
   
    private $rs;
        private $acmsistemas;
        private $hostname_acmsistemas = "localhost";
        private $database_acmsistemas = "acmsiste_alfamedic";
        public $username_acmsistemas = "root";
        public $password_acmsistemas = "";
       
    public function __construct(){
     
          $this->acmsistemas = mysql_pconnect($this->hostname_acmsistemas, $this->username_acmsistemas, $this->password_acmsistemas) or die("NO HAY CONEXION");
       
    }      
       
    public function consulta($sql)
        {
        if (!($this->acmsistemas === false))
        {
                if (mysql_select_db($this->database_acmsistemas, $this->acmsistemas) === false)
                {
                    echo('Error con la Base de Datos: ' . mysql_error());
                    continue;
                }
                else
                {
                $this->rs=@mysql_query($sql);
                    if(!$this->rs)
                        {
                                echo 'No se puede ejecutar la consulta SQL';
                        }
                        else
                        {
                                return $this->rs;              
                        }
                }
            }
    }
       
    public function respuesta(){
        return @mysql_fetch_object($this->rs);
    }
   
    public function getRs(){
        return $this->rs;      
    }
}
?>