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