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 #176500 is a reply to message #176497] Sun, 08 January 2012 18:28 Go to previous messageGo to previous message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma:
Member
Am 2012-01-08 18:57, M. Strobel meinte:
> Am 08.01.2012 18:33, schrieb Gregor Kofler:
>> Am 2012-01-08 15:00, M. Strobel meinte:
>>> 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
>>
>> Can you elaborate on that? I'd say: Nonsense. (You know, mysqli and
>> mysql are also "compiled extensions"...)
>>
>> Gregor
>
> PDO is an abstraction layer, but only at the call level. This is
> better than none.


> I think people only talking about mysql are thinking small. You
> should not give away flexibility when it comes at small cost.

I know what PDO does. And does not. Flexibility is quite limited. Take a
query with a LIMIT clause and try to execute it on a MSSQL server. Or
dealing with date data. IOW: Unless you stick to (really) simple CRUD
queries, the additional abstraction layer of PDO won't add an awful lot
of flexibility. Agreed, the interface won't change when switching databases.

> Small cost: the alleged performance of PDO is rather my
> experience. Additionally the web search turned up in the first hits:
> http://www.el-bato.de/it/php-mysql-vs-mysqli-vs-pdo-performance
> (sorry, in german)

I doubt that with your average web application the execution time of db
calls will be a problem at all. Proper db design, indexing and effort
put into optimizing the queries themselves will yield much more
performance gain. (The above benchmarks show that the impact of PDO is
little with basic queries. How about memory consumption, will the
benchmarks hold with all data types, etc?)

> Before we start discussing benchmarks I would like to know: what
> especially do you not like about it?

You stating "the overhead is minimal due to the fact it is a compiled
extension". Just being a compiled extension doesn't say anything about
performance penalties (or lack thereof).

Gregor
[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: Fri Nov 22 12:14:02 GMT 2024

Total time taken to generate the page: 0.04612 seconds