Thinkphp Study 11

Source: Internet
Author: User

Original: thinkphp Study 11

I. Common and consistent operation
1.where
Help us set query criteria
2.order
Sort the results
$arr = $m->order (' id desc ')->select ();
$arr = $m->order (array (' id ' = ' desc ', ' sex ' = ' asc '))->select ();
3.limit
Limit results
Limit (2,5)
Limit (' 2,5 ')
Limit (//limit) (0,10)
4.field
Set query fields
Field (' username as Name,id ')
Field (Array (' username ' = ' name ', ' ID ')
Field (' id ', true)//Get all fields except ID
5.table
6.group
7.having
Second, supplementary
Alias is used to define the aliases string for the current data table
Page is used to query paging (internally converted to limit) strings and numbers
Join* for join support strings and arrays for queries
Union* used to support strings, arrays, and objects for the Union of Queries
Distinct distinct support for querying Boolean values
Lock mechanism Boolean value for the database
Cache supports multiple parameters for query caching (later described in detail in the cache section)
Relation for associative queries (requires associated model extension support) strings
Validate for data auto-validation arrays
Auto for data auto-complete array
Filter for data filtering strings
scope* for naming range strings, arrays

Thinkphp Study 11

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.