Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!not-for-mail From: "M. Strobel" Newsgroups: comp.lang.php Subject: Re: transfering all MySQL rows to an array Date: Sun, 08 Jan 2012 15:00:40 +0100 Lines: 27 Message-ID: <9mtls9Fhk7U1@mid.uni-berlin.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de dscAS6hloA5nPXOChxiP9As/b4kv+l1Pq3sKGtgP3irfLqNnA= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.24) Gecko/20111101 SUSE/3.1.16 Lightning/1.0b2 Thunderbird/3.1.16 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4286 Am 08.01.2012 12:49, schrieb bill: > On 1/7/2012 4:07 PM, Jerry Stuckle wrote: >> On 1/7/2012 3:03 PM, bill wrote: >>> Yes, I know I can do it using a while statement, but is there a >>> PHP >>> mysql function to move all the data obtained in a query to an >>> array that >>> can be returned from a user written function in one statement ? >>> >>> bill >> >> No, you need to loop through all the rows returned and place them >> in your own array. >> > Thanks, I will write my own. But, I like to check before I > reinvent the wheel. > > bill I would recommend to check if you can use PDO. The overhead is minimal due to the fact it is a compiled extension, and the object functions are just gorgeous: each row goes into one object. Together with objects specifically defined for your database tables this makes an easy start into OO. /Str.