YII2-database query operations

Source: Internet
Author: User
Does YII2 look like the M function in the TP method, you do not need to create a model class for this table in the models file. You can also operate on tables in the database. Does YII2 look like the M function in the TP method, you do not need to create a model class for this table in the models file to operate tables in the database.

Reply content:

Does YII2 perform operations on tables in the database without the need to create a model class for the table in the models file like the M function in the TP method?

Use yii \ db \ Query; $ users = (new Query ()-> from ('user')-> all ();

YII2 I didn't see any professional M functions. For details about how to operate the database in YII, refer to the following webpage:
Http://www.cnblogs.com/rhythmK/p/5135476.html

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.