Highlighted

CF queries and memory

Explorer ,
Jan 27, 2017

Copy link to clipboard

Copied

Hi,

I am in the process of translating a CF application to PHP.

I have a question about queries, please tell me if I'm right:

If I understand well, the major difference  between CF queries and PHP queries is that in CF, the whole set of records is fetched and an array is generated containing all data in one shot. On the other hand in PHP, only one row is returned and one has to fetch rows one by one so it takes very less memory at a time.

Is this right ?

My application uses only rather small queries and the use of memory has never been a problem in the CF version, so I intend to emulate the way CF works in PHP to simplify the work of translation.

Any comment ?

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

There is no difference between ColdFusion and PHP in what you get when, for example, a select-query runs. In either case, you get a result-set containing all the rows and columns.

TOPICS
Database access

Views

355

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

CF queries and memory

Explorer ,
Jan 27, 2017

Copy link to clipboard

Copied

Hi,

I am in the process of translating a CF application to PHP.

I have a question about queries, please tell me if I'm right:

If I understand well, the major difference  between CF queries and PHP queries is that in CF, the whole set of records is fetched and an array is generated containing all data in one shot. On the other hand in PHP, only one row is returned and one has to fetch rows one by one so it takes very less memory at a time.

Is this right ?

My application uses only rather small queries and the use of memory has never been a problem in the CF version, so I intend to emulate the way CF works in PHP to simplify the work of translation.

Any comment ?

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

There is no difference between ColdFusion and PHP in what you get when, for example, a select-query runs. In either case, you get a result-set containing all the rows and columns.

TOPICS
Database access

Views

356

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 27, 2017 0
Adobe Community Professional ,
Feb 08, 2017

Copy link to clipboard

Copied

There is no difference between ColdFusion and PHP in what you get when, for example, a select-query runs. In either case, you get a result-set containing all the rows and columns.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 08, 2017 0
Claude1 LATEST
Explorer ,
Feb 08, 2017

Copy link to clipboard

Copied

Thanks.

I have made a class that emulate as close as possible the way CFQUERY works and it makes my conversion much easier.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 08, 2017 0