PHPCMS Database Operations

Source: Internet
Author: User

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

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.