How does Thinkphp call data tables with different table prefixes in the database?

Source: Internet
Author: User
How does Thinkphp call data tables with different table prefixes in the database? generally, the prefixes of data tables in thinkphp are uniform, but sometimes the requirements are different, for example, if you need to have a table prefix and a different table prefix during TP deployment, how can you call this function? Of course, if a beginner answers this question, he will certainly say that it will be called using native SQL. if you have this kind of thinking, I suggest you study hard. why? What do native thinkphp do ?!


Reply to discussion (solution)

$ Model-> table ('think _ user')-> where ('status> 1')-> select ();

Http://document.thinkphp1.cn/manual_3_2.html#table

I really want to know what's wrong with native. thinkphp encapsulates it for convenience. Is it possible to use native in special circumstances?

Do not be bound by the framework.

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.