PEAR::DB Question about array

From: Date: Wed, 13 Apr 2005 18:10:58 +0000
Subject: PEAR::DB Question about array
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18733@lists.php.net to get a copy of this message
Hi, Okey I'm quite new to that one but I'll ask anyway, I'm trying to build a function which returns the results array with, of course, the content of the Query, I have tried: function getUserInfo($username) { $db =& DB::connect(DSN); if (PEAR::isError($db)) { die($db->getMessage()); } $db->setFetchMode(DB_FETCHMODE_ASSOC); $res =& $db->query("BIG SELECT QUERY"); if (PEAR::isError($res)) {
    	   die($res->getMessage());
} return $res; // that should return the result array } I guess, that its not retur that array I really want in my main program. So, I'm a bit confused, I think I cannot return an array while in the FetchInto Loop. I'd like to call the elements of my array in the mainloop then with echo $res['element']; or something like that. Thanks for any hints! -- Oliver

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