FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » transfering all MySQL rows to an array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: transfering all MySQL rows to an array [message #176538 is a reply to message #176531] Mon, 09 January 2012 11:59 Go to previous messageGo to previous message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma:
Senior Member
On 01/09/2012 03:55 AM, M. Strobel wrote:
> Am 09.01.2012 01:04, schrieb Norman Peelman:
>> On 01/08/2012 08:54 AM, M. Strobel wrote:
>>> Am 08.01.2012 02:06, schrieb Jerry Stuckle:
>>>> On 1/7/2012 3:53 PM, Luuk wrote:
>>>> > On 07-01-2012 21:03, 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
>>>> >
>>>> > you mean this:
>>>> > http://php.net/manual/en/pdostatement.fetchall.php
>>>> >
>>>> > ?
>>>> >
>>>> > (less than 5 mins of Google)
>>>> >
>>>>
>>>> Which only works if you're using PDO. It doesn't work if you're
>>>> using the mysql(i)_xxx() functions.
>>>>
>>>
>>> Yes. Then he should use PDO, recommended.
>>>
>>> /Str.
>>
>> http://www.php.net/manual/en/mysqli-result.fetch-all.php
>>
>
> Thanks for telling me. If that function would not exist a foreach
> loop would do it.
>
> But I advocate PDO.
>
> I have the impression that on c.l.p posters do not care much
> about to whom they respond.
>
> /Str.

Just consider that any function is using a loop to read the entire
result set, whether built-in or user coded. Not gonna make that much of
a difference as far as that goes.

--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sessions timeout
Next Topic: scoping inside a block
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 20:12:08 GMT 2024

Total time taken to generate the page: 0.03810 seconds