


Related query examples in ThinkPHP, ThinkPHP related examples_PHP tutorial
Jul 13, 2016 am 10:12 AMRelated query examples in ThinkPHP, ThinkPHP related examples
The examples in this article describe the usage of related queries in ThinkPHP. Share it with everyone for your reference. The specific analysis is as follows:
In THINKPHP, associated queries (multi-table queries) can use the table() method or the join method, as shown in the following example:
1. table()
2. join()
$list = $user->join('RIGHT JOIN user_profile ON user_stats.id = user_profile.typeid' )->select();
3. Native query
$sql = 'select a.id,a.title,b.content from think_test1 as a, think_test2 as b where a.id=b.id '.$map.' order by a.id '.$sort.' limit '.$p->firstRow.','.$p->listRows;
$voList = $Model->query($sql);
4. Multi-table query
Or:
I hope this article will be helpful to everyone’s PHP programming based on the ThinkPHP framework.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to check your academic qualifications on Xuexin.com

12306 How to check historical ticket purchase records How to check historical ticket purchase records

There are several versions of thinkphp

Which one is better, laravel or thinkphp?

How to check the activation date on Apple mobile phone
