First, check
①select ($where = ', $data = ' * ', $limit = ', $order = ', $group = ', $key = ')
/** * Execute SQL query * @param $where query Criteria [example ' name ' = ' $name '] * @param $data field value to query [example ' name ', ' Gender ', ' Birthday '] * @param $limit Returns the result range [Example: 10 or 10, 10 default is empty] * @param $order Sort By default [sorted by database default] * @ Param $group grouping method [default is empty] * @param $key return array key name sort * @return array Query result set * /
②listinfo ($where = ", $order =", $page = 1, $pagesize =, $key = ", $setpages = ten, $urlrule =", $array = Array (), $da TA = ' * ')
/** * Querying multiple data and paging * @param $where * @param $order * @param $page * @param $pagesize * @return Unkno Wn_type * *
③get_one ($where = ', $data = ' * ', $order = ', $group = ')
/** * Get a single record query * @param $where query Criteria * @param $data field values to query [example ' name ', ' gender ', ' birthday '] * @param $order Sort By default [sorted by database default] * @param $group GROUP By default [empty] * @return array/ Null data Query result set, if not present, returns null */
④query ($sql)
/** * Execute SQL query directly * @param $sql Query SQL statement * @return boolean/query Resource If the resource handle is returned as a query statement , otherwise return true/false */
Second, increase
①insert ($data, $return _insert_id = False, $replace = False)
/** * Perform add record operation * @param $data The data to be incremented, the parameter is an array. The array key is the field value, the array value is the data value * @param $return _insert_id Returns the new ID number * @param $replace whether to add data using replace into * return Boolean */
②INSERT_ID ()
/** * Gets the primary key number of the last added record * @return int * /
Third, change
①update ($data, $where = ")
/** * Perform update record action * @param $data The data content to be updated, the parameter can be an array or a string, which is recommended. * Array key is the field value when the array value is the data value * is a string when [Example: ' Name ' = ' phpcms ', ' hits ' = ' hits ' +1]. * for Arrays [Example: Array (' name ' = ' = ' phpcms ', ' password ' = ' 123456 ')] * An array of the other uses of the [' name ' = ' = ' +=1 ', ' base ' = '-=1 '); the program automatically resolves to ' name ' = ' name ' + 1, ' base ' = ' base '-1 * @param $where condition to update data, which can be an array or string * @return Boolean */
Iv. deletion of
①delete ($where)
/** * Perform delete record operation * @param $where Delete data conditions, do not fill empty. * @return Boolean */
PHPCMS Database Operations