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
Switch to threaded view of this topic Create a new topic Submit Reply
transfering all MySQL rows to an array [message #176461] Sat, 07 January 2012 20:03 Go to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
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
Re: transfering all MySQL rows to an array [message #176463 is a reply to message #176461] Sat, 07 January 2012 20:53 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
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
Re: transfering all MySQL rows to an array [message #176467 is a reply to message #176461] Sat, 07 January 2012 21:07 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176468 is a reply to message #176463] Sun, 08 January 2012 01:06 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176472 is a reply to message #176461] Sun, 08 January 2012 09:39 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?

If you're using the improved mysql interface (mysqli) I believe there's a
function you can call on the result .... can't remember the name, but if
you check the mysqli result documentation on the php documentation
website it should be there.

I have a vague recollection that the availability of said function might
refer on some php / mysql configuration options as well, or possibly
build switches.

Rgds

Denis McMahon
Re: transfering all MySQL rows to an array [message #176474 is a reply to message #176472] Sun, 08 January 2012 10:31 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Denis McMahon wrote:

> On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?
>
> If you're using the improved mysql interface (mysqli) I believe there's a
> function you can call on the result .... can't remember the name, but if
> you check the mysqli result documentation on the php documentation
> website it should be there.

It's mysqli_result::fetch_all(), of course. But PDO also has that feature
(PDOStatement::fetchAll()).

> I have a vague recollection that the availability of said function might
> refer on some php / mysql configuration options as well, or possibly
> build switches.

Posting your beliefs and vague ideas is helping nobody. If you are not sure
at all, simply do not post. We do not depend on you saving the world alone.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Re: transfering all MySQL rows to an array [message #176475 is a reply to message #176463] Sun, 08 January 2012 11:47 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
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
Re: transfering all MySQL rows to an array [message #176476 is a reply to message #176467] Sun, 08 January 2012 11:49 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
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
Re: transfering all MySQL rows to an array [message #176478 is a reply to message #176468] Sun, 08 January 2012 13:54 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176479 is a reply to message #176476] Sun, 08 January 2012 14:00 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176480 is a reply to message #176474] Sun, 08 January 2012 14:02 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 08.01.2012 11:31, schrieb Thomas 'PointedEars' Lahn:
> Denis McMahon wrote:
>
>> On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?
>>
>> If you're using the improved mysql interface (mysqli) I believe there's a
>> function you can call on the result .... can't remember the name, but if
>> you check the mysqli result documentation on the php documentation
>> website it should be there.
>
> It's mysqli_result::fetch_all(), of course. But PDO also has that feature
> (PDOStatement::fetchAll()).
>
>> I have a vague recollection that the availability of said function might
>> refer on some php / mysql configuration options as well, or possibly
>> build switches.
>
> Posting your beliefs and vague ideas is helping nobody. If you are not sure
> at all, simply do not post. We do not depend on you saving the world alone.

Same to you. Pedants do not make a good helper.

>
>
> PointedEars
Re: transfering all MySQL rows to an array [message #176482 is a reply to message #176478] Sun, 08 January 2012 14:12 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176495 is a reply to message #176479] Sun, 08 January 2012 17:33 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
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
Re: transfering all MySQL rows to an array [message #176496 is a reply to message #176476] Sun, 08 January 2012 17:56 Go to previous messageGo to next message
Peter is currently offline  Peter
Messages: 15
Registered: March 2003
Karma: 0
Junior Member
In article <Bc-dnXZdBI8hH5TSnZ2dnUVZ_gWdnZ2d(at)cablespeedmi(dot)com>,
nobody(at)spamcop(dot)net says...
> 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.
>

Not much writing involved though. Just a couple of lines of code.

--
Pete Ives
Remove All_stRESS before sending me an email
Re: transfering all MySQL rows to an array [message #176497 is a reply to message #176495] Sun, 08 January 2012 17:57 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176499 is a reply to message #176495] Sun, 08 January 2012 18:22 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 08.01.2012 18:33, schrieb Gregor Kofler:
> Am 2012-01-08 15:00, M. Strobel meinte:
>> 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

in addition to my post at 18:57 MET I would like to elaborate:

You cannot expect PDO to be faster than mysql[i]:

mysql is just a call interface from PHP to the mysql client lib.
Now PDO is a call interface to PDO_mysql which in turn calls the
client lib, that would be one level more.

This layered design is still state of the art. I said still
because it is so for a long time already.

If you find evidence that PDO might even perform better than the
direct mysql interface, this tells me:

- they are not doing something the others do and which is useful

- they are not doing something the others do and which is not needed

- they just did it right

So pick your reason.

/Str.
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 next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
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
Re: transfering all MySQL rows to an array [message #176502 is a reply to message #176500] Sun, 08 January 2012 18:56 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176505 is a reply to message #176502] Sun, 08 January 2012 19:04 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
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
Re: transfering all MySQL rows to an array [message #176507 is a reply to message #176500] Sun, 08 January 2012 19:31 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Gregor Kofler, 2012-01-08 19:28:

> Am 2012-01-08 18:57, M. Strobel meinte:
[...]
>> 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).

Ok, your point. But i also ask: What is the problem with PDO?

See also <http://jnrbsn.com/2010/06/mysqli-vs-pdo-benchmarks>



--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: transfering all MySQL rows to an array [message #176513 is a reply to message #176507] Sun, 08 January 2012 21:43 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
Am 2012-01-08 20:31, Arno Welzel meinte:
> Gregor Kofler, 2012-01-08 19:28:
>
>> Am 2012-01-08 18:57, M. Strobel meinte:
> [...]
>>> 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).
>
> Ok, your point. But i also ask: What is the problem with PDO?

None in particular. I never said that there is "a problem" with PDO.
I said that

"[overhead of PDO is minimal] due to the fact it is a compiled extension"

is nonsense (since all extensions are "compiled extensions").

Gregor
Re: transfering all MySQL rows to an array [message #176519 is a reply to message #176505] Sun, 08 January 2012 23:07 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176522 is a reply to message #176519] Mon, 09 January 2012 00:02 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176523 is a reply to message #176478] Mon, 09 January 2012 00:04 Go to previous messageGo to next message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma: 0
Senior Member
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?-
Re: transfering all MySQL rows to an array [message #176525 is a reply to message #176480] Mon, 09 January 2012 00:18 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Sun, 08 Jan 2012 15:02:11 +0100, M. Strobel wrote:

> Same to you. Pedants do not make a good helper.

trollpedant obviously missed the point of my post, which was that I'd
seen the information OP was looking for in the documentation on the
website, but couldn't remember exactly where, or exactly what it said,
and I was suggesting that the OP go and read it himself, because I don't
see any point in me doing OPs googling for him.

Rgds

Denis McMahon
Re: transfering all MySQL rows to an array [message #176526 is a reply to message #176480] Mon, 09 January 2012 01:02 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
M. Strobel wrote:

> Am 08.01.2012 11:31, schrieb Thomas 'PointedEars' Lahn:
>> Denis McMahon wrote:
>>> On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?
>>>
>>> If you're using the improved mysql interface (mysqli) I believe there's
>>> a function you can call on the result .... can't remember the name, but
>>> if you check the mysqli result documentation on the php documentation
>>> website it should be there.
>>
>> It's mysqli_result::fetch_all(), of course. But PDO also has that
>> feature (PDOStatement::fetchAll()).
>>
>>> I have a vague recollection that the availability of said function might
>>> refer on some php / mysql configuration options as well, or possibly
>>> build switches.
>>
>> Posting your beliefs and vague ideas is helping nobody. If you are not
>> sure at all, simply do not post. We do not depend on you saving the
>> world alone.
>
> Same to you. Pedants do not make a good helper.

I have posted a helpful and correct answer. And you?


Score adjusted

PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
Re: transfering all MySQL rows to an array [message #176527 is a reply to message #176495] Mon, 09 January 2012 01:05 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Gregor Kofler wrote:

> 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 ?
>>>> 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.
>> 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"...)

Please do not feed the troll (have you noticed their From header field
value?). Thank you in advance.


Regards,

PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
Re: transfering all MySQL rows to an array [message #176529 is a reply to message #176526] Mon, 09 January 2012 03:02 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 1/8/2012 8:02 PM, Thomas 'PointedEars' Lahn wrote:
> M. Strobel wrote:
>
>> Am 08.01.2012 11:31, schrieb Thomas 'PointedEars' Lahn:
>>> Denis McMahon wrote:
>>>> On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?
>>>>
>>>> If you're using the improved mysql interface (mysqli) I believe there's
>>>> a function you can call on the result .... can't remember the name, but
>>>> if you check the mysqli result documentation on the php documentation
>>>> website it should be there.
>>>
>>> It's mysqli_result::fetch_all(), of course. But PDO also has that
>>> feature (PDOStatement::fetchAll()).
>>>
>>>> I have a vague recollection that the availability of said function might
>>>> refer on some php / mysql configuration options as well, or possibly
>>>> build switches.
>>>
>>> Posting your beliefs and vague ideas is helping nobody. If you are not
>>> sure at all, simply do not post. We do not depend on you saving the
>>> world alone.
>>
>> Same to you. Pedants do not make a good helper.
>
> I have posted a helpful and correct answer. And you?
>

ROFLMAO!

>
> Score adjusted
>
> PointedEars


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176531 is a reply to message #176523] Mon, 09 January 2012 08:55 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
Re: transfering all MySQL rows to an array [message #176532 is a reply to message #176526] Mon, 09 January 2012 09:06 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 09.01.2012 02:02, schrieb Thomas 'PointedEars' Lahn:
> M. Strobel wrote:
>
>> Am 08.01.2012 11:31, schrieb Thomas 'PointedEars' Lahn:
>>> Denis McMahon wrote:
>>>> On Sat, 07 Jan 2012 15:03:45 -0500, 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 ?
>>>>
>>>> If you're using the improved mysql interface (mysqli) I believe there's
>>>> a function you can call on the result .... can't remember the name, but
>>>> if you check the mysqli result documentation on the php documentation
>>>> website it should be there.
>>>
>>> It's mysqli_result::fetch_all(), of course. But PDO also has that
>>> feature (PDOStatement::fetchAll()).
>>>
>>>> I have a vague recollection that the availability of said function might
>>>> refer on some php / mysql configuration options as well, or possibly
>>>> build switches.
>>>
>>> Posting your beliefs and vague ideas is helping nobody. If you are not
>>> sure at all, simply do not post. We do not depend on you saving the
>>> world alone.
>>
>> Same to you. Pedants do not make a good helper.
>
> I have posted a helpful and correct answer. And you?
>
>
> Score adjusted
>
> PointedEars

Same to you went to "We do not depend on you saving the
world alone". It is not wrong, and your critics are not wrong,
but I found it a bit rude.


/Str.
Re: transfering all MySQL rows to an array [message #176533 is a reply to message #176522] Mon, 09 January 2012 09:58 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
Path: textnews.cambrium.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.13 3.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news. xs4all.nl!news.xs4all.nl!not-for-mail
Date: Mon, 09 Jan 2012 10:58:29 +0100
From: Erwin Moller <erwinmoller(at)xs4all(dot)nl>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
Newsgroups: comp.lang.php
Subject: Re: transfering all MySQL rows to an array
References: <cYSdndOZupi1OJXSnZ2dnUVZ_s2dnZ2d(at)cablespeedmi(dot)com> <jeac5t$9fm$2(at)dont-email(dot)me> <Bc-dnXZdBI8hH5TSnZ2dnUVZ_gWdnZ2d(at)cablespeedmi(dot)com> <9mtls9Fhk7U1(at)mid(dot)uni-berlin(dot)de> <jeck0e$3kc$1(at)dont-email(dot)me> <9mu3ncF3n3U1(at)mid(dot)uni-berlin(dot)de> <jecn7j$off$1(at)dont-email(dot)me> <9mu778FolU1(at)mid(dot)uni-berlin(dot)de> <jecpb3$6jr$1(at)dont-email(dot)me> <9mulu8Fld7U1(at)mid(dot)uni-berlin(dot)de> <jedaq1$gh4$2(at)dont-email(dot)me>
In-Reply-To: <jedaq1$gh4$2(at)dont-email(dot)me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 48
Message-ID: <4f0aba41$0$6975$e4fe514c(at)news2(dot)news(dot)xs4all(dot)nl>
NNTP-Posting-Host: 83.163.233.207
X-Trace: 1326103105 news2.news.xs4all.nl 6975 83.163.233.207:4224
Xref: textnews.cambrium.nl comp.lang.php:135937

On 1/9/2012 1:02 AM, Jerry Stuckle wrote:
> 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.
>

Hi Jerry and Gregor,

I am also confused by the naming used regarding extensions used in PHP.
I know extensions you enable in php.ini are "real" extensions in the
sense that uncommenting them will add functionality to PHP (by means of
exposing the functionality in a so or dll to PHP.).
This in contrast to adding functionality WRITTEN in PHP to PHP. (Like
any function you write yourself in PHP.)

But the word "extension" is used a lot.
For example in PEAR:
PEAR - PHP Extension and Application Repository
while all in PEAR is only PHP-code (to my knowledge).

Just saying I can really understand Strobels confusion. :-)

Can you shed some light on that?
Was PEAR maybe a misnomer?

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: transfering all MySQL rows to an array [message #176534 is a reply to message #176533] Mon, 09 January 2012 10:09 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
Am 2012-01-09 10:58, Erwin Moller meinte:
> On 1/9/2012 1:02 AM, Jerry Stuckle wrote:
>> 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.
>>
>
> Hi Jerry and Gregor,
>
> I am also confused by the naming used regarding extensions used in PHP.
> I know extensions you enable in php.ini are "real" extensions in the
> sense that uncommenting them will add functionality to PHP (by means of
> exposing the functionality in a so or dll to PHP.).
> This in contrast to adding functionality WRITTEN in PHP to PHP. (Like
> any function you write yourself in PHP.)
>
> But the word "extension" is used a lot.
> For example in PEAR:
> PEAR - PHP Extension and Application Repository
> while all in PEAR is only PHP-code (to my knowledge).
>
> Just saying I can really understand Strobels confusion. :-)
>
> Can you shed some light on that?

The manual features a list of "real" extensions:

http://php.net/manual/en/extensions.php

> Was PEAR maybe a misnomer?

IMO: Yes.

Gregor
Re: transfering all MySQL rows to an array [message #176535 is a reply to message #176534] Mon, 09 January 2012 10:27 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 09-01-2012 11:09, Gregor Kofler wrote:
> Am 2012-01-09 10:58, Erwin Moller meinte:
>> On 1/9/2012 1:02 AM, Jerry Stuckle wrote:
>>> 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.
>>>
>>
>> Hi Jerry and Gregor,
>>
>> I am also confused by the naming used regarding extensions used in PHP.
>> I know extensions you enable in php.ini are "real" extensions in the
>> sense that uncommenting them will add functionality to PHP (by means of
>> exposing the functionality in a so or dll to PHP.).
>> This in contrast to adding functionality WRITTEN in PHP to PHP. (Like
>> any function you write yourself in PHP.)
>>
>> But the word "extension" is used a lot.
>> For example in PEAR:
>> PEAR - PHP Extension and Application Repository
>> while all in PEAR is only PHP-code (to my knowledge).
>>
>> Just saying I can really understand Strobels confusion. :-)
>>
>> Can you shed some light on that?
>
> The manual features a list of "real" extensions:
>
> http://php.net/manual/en/extensions.php
>
>> Was PEAR maybe a misnomer?
>
> IMO: Yes.
>
> Gregor

Interesting reading from "What is PHP's MySQL Native Driver?" on
http://www.php.net/manual/en/mysqli.overview.php#mysqli.overview.mysqlnd

The mysql extension, the mysqli extension and the PDO MySQL driver *can*
each be individually configured to use either libmysql or mysqlnd. As
mysqlnd is designed specifically to be utilised in the PHP system it has
numerous memory and speed enhancements over libmysql. You are strongly
encouraged to take advantage of these improvements.

The table at the end suggests that PDO is the future when talking about
PHP<-->MySQL


--
Luuk
Re: transfering all MySQL rows to an array [message #176536 is a reply to message #176534] Mon, 09 January 2012 10:32 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 09.01.2012 11:09, schrieb Gregor Kofler:
> Am 2012-01-09 10:58, Erwin Moller meinte:
---cut
> The manual features a list of "real" extensions:
>
> http://php.net/manual/en/extensions.php
>
>> Was PEAR maybe a misnomer?
>
> IMO: Yes.
>
> Gregor

I would like to check if of all the extensions listed in your
link are compiled, but do not have the time to install them all.

/Str.
Re: transfering all MySQL rows to an array [message #176537 is a reply to message #176535] Mon, 09 January 2012 10:41 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 09.01.2012 11:27, schrieb Luuk:

> Interesting reading from "What is PHP's MySQL Native Driver?" on
> http://www.php.net/manual/en/mysqli.overview.php#mysqli.overview.mysqlnd
>
> The mysql extension, the mysqli extension and the PDO MySQL driver *can*
> each be individually configured to use either libmysql or mysqlnd. As
> mysqlnd is designed specifically to be utilised in the PHP system it has
> numerous memory and speed enhancements over libmysql. You are strongly
> encouraged to take advantage of these improvements.
>
> The table at the end suggests that PDO is the future when talking about
> PHP<-->MySQL
>
>

Please all (interested in the subject) update my post (date
2012-01-08 18:57 MET) with this mysqlnd information.

/Str.
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 next message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma: 0
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?-
Re: transfering all MySQL rows to an array [message #176539 is a reply to message #176531] Mon, 09 January 2012 12:05 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: transfering all MySQL rows to an array [message #176540 is a reply to message #176535] Mon, 09 January 2012 12:24 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
Am 2012-01-09 11:27, Luuk meinte:
> On 09-01-2012 11:09, Gregor Kofler wrote:
>> Am 2012-01-09 10:58, Erwin Moller meinte:
>>> On 1/9/2012 1:02 AM, Jerry Stuckle wrote:
>>>> 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.
>>>>
>>>
>>> Hi Jerry and Gregor,
>>>
>>> I am also confused by the naming used regarding extensions used in PHP.
>>> I know extensions you enable in php.ini are "real" extensions in the
>>> sense that uncommenting them will add functionality to PHP (by means of
>>> exposing the functionality in a so or dll to PHP.).
>>> This in contrast to adding functionality WRITTEN in PHP to PHP. (Like
>>> any function you write yourself in PHP.)
>>>
>>> But the word "extension" is used a lot.
>>> For example in PEAR:
>>> PEAR - PHP Extension and Application Repository
>>> while all in PEAR is only PHP-code (to my knowledge).
>>>
>>> Just saying I can really understand Strobels confusion. :-)
>>>
>>> Can you shed some light on that?
>>
>> The manual features a list of "real" extensions:
>>
>> http://php.net/manual/en/extensions.php
>>
>>> Was PEAR maybe a misnomer?
>>
>> IMO: Yes.
>>
>> Gregor
>
> Interesting reading from "What is PHP's MySQL Native Driver?" on
> http://www.php.net/manual/en/mysqli.overview.php#mysqli.overview.mysqlnd
>
> The mysql extension, the mysqli extension and the PDO MySQL driver *can*
> each be individually configured to use either libmysql or mysqlnd. As
> mysqlnd is designed specifically to be utilised in the PHP system it has
> numerous memory and speed enhancements over libmysql. You are strongly
> encouraged to take advantage of these improvements.
>
> The table at the end suggests that PDO is the future when talking about
> PHP<-->MySQL

Erm...

"
[...]

Recommended by MySQL for new projects
mysqli: Yes - preferred option
PDO: Yes

[...]
"

There's nothing wrong with PDO, but I can't see how this table proves
your claim.

Gregor
Re: transfering all MySQL rows to an array [message #176541 is a reply to message #176536] Mon, 09 January 2012 12:30 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
Am 2012-01-09 11:32, M. Strobel meinte:
> Am 09.01.2012 11:09, schrieb Gregor Kofler:
>> Am 2012-01-09 10:58, Erwin Moller meinte:
> ---cut
>> The manual features a list of "real" extensions:
>>
>> http://php.net/manual/en/extensions.php
>>
>>> Was PEAR maybe a misnomer?
>>
>> IMO: Yes.
>>
>> Gregor
>
> I would like to check if of all the extensions listed in your
> link are compiled, but do not have the time to install them all.

Quite a few of them are already part of the PHP core or added when
compiled with appropriate parameters. Just look up the "Installation"
page for each extension. None of the randomly picked extensions were not
"compiled". They are either part of the PHP core or belong to PECL.

Gregor
Re: transfering all MySQL rows to an array [message #176542 is a reply to message #176540] Mon, 09 January 2012 12:31 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 09-01-2012 13:24, Gregor Kofler wrote:
> Am 2012-01-09 11:27, Luuk meinte:
>> On 09-01-2012 11:09, Gregor Kofler wrote:
>>> Am 2012-01-09 10:58, Erwin Moller meinte:
>>>> On 1/9/2012 1:02 AM, Jerry Stuckle wrote:
>>>> > 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.
>>>> >
>>>>
>>>> Hi Jerry and Gregor,
>>>>
>>>> I am also confused by the naming used regarding extensions used in PHP.
>>>> I know extensions you enable in php.ini are "real" extensions in the
>>>> sense that uncommenting them will add functionality to PHP (by means of
>>>> exposing the functionality in a so or dll to PHP.).
>>>> This in contrast to adding functionality WRITTEN in PHP to PHP. (Like
>>>> any function you write yourself in PHP.)
>>>>
>>>> But the word "extension" is used a lot.
>>>> For example in PEAR:
>>>> PEAR - PHP Extension and Application Repository
>>>> while all in PEAR is only PHP-code (to my knowledge).
>>>>
>>>> Just saying I can really understand Strobels confusion. :-)
>>>>
>>>> Can you shed some light on that?
>>>
>>> The manual features a list of "real" extensions:
>>>
>>> http://php.net/manual/en/extensions.php
>>>
>>>> Was PEAR maybe a misnomer?
>>>
>>> IMO: Yes.
>>>
>>> Gregor
>>
>> Interesting reading from "What is PHP's MySQL Native Driver?" on
>> http://www.php.net/manual/en/mysqli.overview.php#mysqli.overview.mysqlnd
>>
>> The mysql extension, the mysqli extension and the PDO MySQL driver *can*
>> each be individually configured to use either libmysql or mysqlnd. As
>> mysqlnd is designed specifically to be utilised in the PHP system it has
>> numerous memory and speed enhancements over libmysql. You are strongly
>> encouraged to take advantage of these improvements.
>>
>> The table at the end suggests that PDO is the future when talking about
>> PHP<-->MySQL
>
> Erm...
>
> "
> [...]
>
> Recommended by MySQL for new projects
> mysqli: Yes - preferred option
> PDO: Yes
>
> [...]
> "
>
> There's nothing wrong with PDO, but I can't see how this table proves
> your claim.
>
> Gregor
>
>
>
>

o, lol, it was not my claim, it was my understanding from looking at
that table.... (acvtive development as of PHP5.3...)

PDO cannot (yet) be the preferred option, because not all options have a
YES... ;)


--
Luuk
Pages (2): [1  2    »]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: sessions timeout
Next Topic: scoping inside a block
Goto Forum:
  

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

Current Time: Sun May 19 04:33:59 GMT 2024

Total time taken to generate the page: 0.03278 seconds