Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4268 > unrolled thread

transfering all MySQL rows to an array

Started bybill <nobody@spamcop.net>
First post2012-01-07 15:03 -0500
Last post2012-01-09 10:06 +0100
Articles 20 on this page of 41 — 11 participants

Back to article view | Back to comp.lang.php


Contents

  transfering all MySQL rows to an array bill <nobody@spamcop.net> - 2012-01-07 15:03 -0500
    Re: transfering all MySQL rows to an array Luuk <Luuk@invalid.lan> - 2012-01-07 21:53 +0100
      Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-07 20:06 -0500
        Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 14:54 +0100
          Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-08 09:12 -0500
          Re: transfering all MySQL rows to an array Norman Peelman <npeelmandog@cfl.rr.com> - 2012-01-08 19:04 -0500
            Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 09:55 +0100
              Re: transfering all MySQL rows to an array Norman Peelman <npeelmandog@cfl.rr.com> - 2012-01-09 06:59 -0500
              Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-09 07:05 -0500
      Re: transfering all MySQL rows to an array bill <nobody@spamcop.net> - 2012-01-08 06:47 -0500
    Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-07 16:07 -0500
      Re: transfering all MySQL rows to an array bill <nobody@spamcop.net> - 2012-01-08 06:49 -0500
        Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 15:00 +0100
          Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-08 18:33 +0100
            Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 18:57 +0100
              Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-08 19:28 +0100
                Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 19:56 +0100
                  Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-08 20:04 +0100
                    Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 00:07 +0100
                      Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-08 19:02 -0500
                        Re: transfering all MySQL rows to an array Erwin Moller <erwinmoller@xs4all.nl> - 2012-01-09 10:58 +0100
                          Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-09 11:09 +0100
                            Re: transfering all MySQL rows to an array Luuk <Luuk@invalid.lan> - 2012-01-09 11:27 +0100
                              Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 11:41 +0100
                              Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-09 13:24 +0100
                                Re: transfering all MySQL rows to an array Luuk <Luuk@invalid.lan> - 2012-01-09 13:31 +0100
                            Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 11:32 +0100
                              Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-09 13:30 +0100
                                Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 13:45 +0100
                Re: transfering all MySQL rows to an array Arno Welzel <usenet@arnowelzel.de> - 2012-01-08 20:31 +0100
                  Re: transfering all MySQL rows to an array Gregor Kofler <usenet@gregorkofler.com> - 2012-01-08 22:43 +0100
            Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 19:22 +0100
            Re: transfering all MySQL rows to an array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 02:05 +0100
        Re: transfering all MySQL rows to an array Peter <pete.ivesAll_stRESS@blueyonder.co.uk> - 2012-01-08 17:56 +0000
    Re: transfering all MySQL rows to an array Denis McMahon <denismfmcmahon@gmail.com> - 2012-01-08 09:39 +0000
      Re: transfering all MySQL rows to an array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-08 11:31 +0100
        Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-08 15:02 +0100
          Re: transfering all MySQL rows to an array Denis McMahon <denismfmcmahon@gmail.com> - 2012-01-09 00:18 +0000
          Re: transfering all MySQL rows to an array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 02:02 +0100
            Re: transfering all MySQL rows to an array Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-08 22:02 -0500
            Re: transfering all MySQL rows to an array "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-09 10:06 +0100

Page 1 of 3  [1] 2 3  Next page →


#4268 — transfering all MySQL rows to an array

Frombill <nobody@spamcop.net>
Date2012-01-07 15:03 -0500
Subjecttransfering all MySQL rows to an array
Message-ID<cYSdndOZupi1OJXSnZ2dnUVZ_s2dnZ2d@cablespeedmi.com>
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

[toc] | [next] | [standalone]


#4270

FromLuuk <Luuk@invalid.lan>
Date2012-01-07 21:53 +0100
Message-ID<dunmt8-bre.ln1@luuk.invalid.lan>
In reply to#4268
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)

-- 
Luuk

[toc] | [prev] | [next] | [standalone]


#4275

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-01-07 20:06 -0500
Message-ID<jeaq7a$pmm$1@dont-email.me>
In reply to#4270
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.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4285

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-08 14:54 +0100
Message-ID<9mtlhgFe7jU2@mid.uni-berlin.de>
In reply to#4275
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.

[toc] | [prev] | [next] | [standalone]


#4289

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-01-08 09:12 -0500
Message-ID<jec87o$tid$2@dont-email.me>
In reply to#4285
On 1/8/2012 8: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.

There are many reasons NOT to use PDO.  The added performance overhead 
is just one of them.

PDO has its uses.  But it is not the end-all to everything.  That's why 
there are different ways of doing what is basically the same thing.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4330

FromNorman Peelman <npeelmandog@cfl.rr.com>
Date2012-01-08 19:04 -0500
Message-ID<jedatj$gvq$1@dont-email.me>
In reply to#4285
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

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

[toc] | [prev] | [next] | [standalone]


#4338

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-09 09:55 +0100
Message-ID<9mvobiFoklU1@mid.uni-berlin.de>
In reply to#4330
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.

[toc] | [prev] | [next] | [standalone]


#4345

FromNorman Peelman <npeelmandog@cfl.rr.com>
Date2012-01-09 06:59 -0500
Message-ID<jeekrm$atq$1@dont-email.me>
In reply to#4338
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?-

[toc] | [prev] | [next] | [standalone]


#4346

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-01-09 07:05 -0500
Message-ID<jeel6m$cdl$1@dont-email.me>
In reply to#4338
On 1/9/2012 3: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.

Your impression is incorrect.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4282

Frombill <nobody@spamcop.net>
Date2012-01-08 06:47 -0500
Message-ID<Bc-dnXddBI_zH5TSnZ2dnUVZ_gWdnZ2d@cablespeedmi.com>
In reply to#4270
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)
>
not using PDO

[toc] | [prev] | [next] | [standalone]


#4274

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-01-07 16:07 -0500
Message-ID<jeac5t$9fm$2@dont-email.me>
In reply to#4268
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.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4283

Frombill <nobody@spamcop.net>
Date2012-01-08 06:49 -0500
Message-ID<Bc-dnXZdBI8hH5TSnZ2dnUVZ_gWdnZ2d@cablespeedmi.com>
In reply to#4274
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

[toc] | [prev] | [next] | [standalone]


#4286

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-08 15:00 +0100
Message-ID<9mtls9Fhk7U1@mid.uni-berlin.de>
In reply to#4283
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.

[toc] | [prev] | [next] | [standalone]


#4302

FromGregor Kofler <usenet@gregorkofler.com>
Date2012-01-08 18:33 +0100
Message-ID<jeck0e$3kc$1@dont-email.me>
In reply to#4286
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

[toc] | [prev] | [next] | [standalone]


#4304

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-08 18:57 +0100
Message-ID<9mu3ncF3n3U1@mid.uni-berlin.de>
In reply to#4302
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.

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)

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

/Str.

[toc] | [prev] | [next] | [standalone]


#4307

FromGregor Kofler <usenet@gregorkofler.com>
Date2012-01-08 19:28 +0100
Message-ID<jecn7j$off$1@dont-email.me>
In reply to#4304
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

[toc] | [prev] | [next] | [standalone]


#4309

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-08 19:56 +0100
Message-ID<9mu778FolU1@mid.uni-berlin.de>
In reply to#4307
Am 08.01.2012 19:28, schrieb Gregor Kofler:
>>
>> 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

compiled extension in C vs. extension in PHP.

/Str.

[toc] | [prev] | [next] | [standalone]


#4312

FromGregor Kofler <usenet@gregorkofler.com>
Date2012-01-08 20:04 +0100
Message-ID<jecpb3$6jr$1@dont-email.me>
In reply to#4309
Am 2012-01-08 19:56, M. Strobel meinte:
> Am 08.01.2012 19:28, schrieb Gregor Kofler:
>>>
>>> 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
> 
> compiled extension in C vs. extension in PHP.

I'm not aware of extensions written in PHP. You could have classes or a
framework written in PHP.

Gregor

[toc] | [prev] | [next] | [standalone]


#4326

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-01-09 00:07 +0100
Message-ID<9mulu8Fld7U1@mid.uni-berlin.de>
In reply to#4312
Am 08.01.2012 20:04, schrieb Gregor Kofler:
> Am 2012-01-08 19:56, M. Strobel meinte:
-------cut
>> compiled extension in C vs. extension in PHP.
> 
> I'm not aware of extensions written in PHP. You could have classes or a
> framework written in PHP.
> 
> Gregor
> 

Most or all of: Mailers, Filers, AJAX, ADODB, PEAR stuff, ...

Maybe you would not call it extension...

/Str.

[toc] | [prev] | [next] | [standalone]


#4329

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-01-08 19:02 -0500
Message-ID<jedaq1$gh4$2@dont-email.me>
In reply to#4326
On 1/8/2012 6:07 PM, M. Strobel wrote:
> Am 08.01.2012 20:04, schrieb Gregor Kofler:
>> Am 2012-01-08 19:56, M. Strobel meinte:
> -------cut
>>> compiled extension in C vs. extension in PHP.
>>
>> I'm not aware of extensions written in PHP. You could have classes or a
>> framework written in PHP.
>>
>> Gregor
>>
>
> Most or all of: Mailers, Filers, AJAX, ADODB, PEAR stuff, ...
>
> Maybe you would not call it extension...
>
> /Str.

No, those are not extensions.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.lang.php


csiph-web