How can I solve the difference between store_result () of mysqli and fetch_all () of PDO?

Source: Internet
Author: User
Q: What is the difference between store_result () of mysqli and fetch_all () of PDO? the two functions return the result set to the local machine at a time? That's why store_result () can improve script efficiency while fetch_all () is not recommended because of its low efficiency. Why are the two functions of the same function so different? Ask the difference between store_result () of mysqli and fetch_all () of PDO
The two functions return the result set to the local machine at one time?

That's why store_result () can improve script efficiency while fetch_all () is not recommended because of its low efficiency.

Why are the two functions of the same function so different?

Thank you!

------ Solution --------------------
What is your teaching material?
Why should we compare different things together?


------ Solution --------------------
Where is the same? the fetchAll () function of PDO is similar to the fetch_all () function of mysqli. Convert all result sets to arrays or objects.
But store_result () is another thing:
If you need to process all records, not just a small part, you can call the store_result () method in the mysqli_stmt object to pass all the results back to the PHP program at a time. This is not only more efficient, but also reduces the burden on the server. The store_result () method is optional, except that reading data does not change anything.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.