Using the CREATE function to update data security usage under ThinkPHP3.2.3

Source: Internet
Author: User

Generally the most commonly used wording:

M (' database name ')->create (); This situation is determined by the system, sometimes quasi, sometimes not, and then a lot of children's shoes on the egg hurt

Standard wording:

①: Data received by post and inserted data into the database

M (' database name ')->create ($_post,1);


②: Data received by get and inserted data into the database

M (' database name ')->create ($_get,1);


③: Data received by post and updates received data to the database

M (' database name ')->create ($_post,2);


④: Data received by Get and update received data to database

M (' database name ')->create ($_get,2);


TP Source code:

/**     *  Create Data Objects   do not save to database      *  @access   public     *  @param  mixed  $data   Create data       *  @param  string  $type   status      *    //   Status      *     $type  =  $type?:(! Empty ($data [$this->GETPK ()]) self::model_update:self::model_insert);      * @ Return mixed     */     function create ($data = ", $ Type= ')            //  operation status      const model_insert          =   1;       //   Insert model Data     const MODEL_UPDATE           =   2;      //   Updating model data 



For more details, refer to: http://blog.csdn.net/df981011512/article/details/52912289

This article from "for the Future" blog, declined reprint!

Using the CREATE function to update data security usage under ThinkPHP3.2.3

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.