Why does the object method not need to be used for database values in many source codes?

Source: Internet
Author: User
Why is the fetch_object () method used for database values in many source codes unnecessary? ------ solution -------------------- The reason is much better. efficiency & nbsp; fetch_object efficiency is the lowest & nbsp; you can refer to the following picture & nbsp; X axis shows the number of data & nbsp; the y axis is the time spent & nbsp; & why does the object method not need to be used for database values in many source codes?
Which of the following is the fetch_object () method?
------ Solution ----------------------
The reason is much better.

1. efficiency problem fetch_object efficiency is the lowest. you can refer to the following picture. the x axis is the number of data. the y axis is the time spent.


2. PHP's operations on arrays are especially convenient for various array operation functions as for objects.

3. The data obtained from fetch_object does not conform to the object-oriented idea (because all member attributes are public) and does not comply with the object-oriented process (because they are objects)

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.