Re: QF_livesearch + mdb2

From: Date: Fri, 30 Nov 2007 10:39:37 +0000
Subject: Re: QF_livesearch + mdb2
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28243@lists.php.net to get a copy of this message
Le 29 nov. 07 à 22:03, Köteles Zoltán a écrit :
Hello, How can I use the QuickForm livesearch package with mdb2. I'd like to search with QF_livesearch in a mdb2 resultset. I try this: function getHotels() {
       $query = "
           SELECT hotel_id,
                  hotel_name
           FROM Hotels
           WHERE is_deleted = '0'
           ORDER BY hotel_name
       ";
       $result =& $mdb2->query($query);
       while ($row = $result->fetchRow()) {
           $this->livesearch[$row['hotel_id']] = $row['hotel_name'];
       }
       return $this->livesearch;
}
$mdb2 seems out of scope in your method, read the PHP manual about variable scope. http://us2.php.net/variables.scope -- Bertrand Mansion Mamasam Work : http://www.mamasam.com Blog : http://golgote.freeflux.net

« previous php.pear.general (#28243) next »