ThinkPHP user-defined model and coherent operation points

Source: Internet
Author: User
Let me summarize what I learned ~ How to obtain the data primary key: $ goods_model-& gt; getPk (); two methods for instantiating a data table: newModel (); M () the shortcut method uses only one memory usage. The first method increases the memory storage capacity each time. query () to obtain the query results... "/> <scripttype =" text/plain Crip

Let me summarize what I learned ~
How to get the data primary key: $ goods_model-> getPk ();
Two ways to instantiate a data table: new Model (); M () Shortcut: the shortcut occupies only one memory, and the first method increases the memory storage each time.
Query () to obtain the query result execute () to obtain the number of affected rows
The D () method is used to obtain the user-defined model. the execution sequence of the D () function is to first find the user-defined model. when the file name and class name comply with the rules, the user-defined model is executed, if any, the table name is queried for instantiation. if the table name is not met, false is returned.

Coherent operation
Field () is the display range, where () is the value condition: Array or object is used as the condition, limit () is the number of values, order (para desc) is the sorting, group () for automatic sorting by field grouping, having () is another value condition. table (tbname) is a cross-table value, table (db. tbname) defines the array $ cont ['para'] = array ('like', '% a %') to generate an array conditional control SQL, sum () summation, avg () average, count () calculates the number

 

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.