PHPCMS V9 Database Operation function

Source: Internet
Author: User

indicates that the default current Load_model (' xxxx ') module is located in the table name xxxx

to specify the table name: Operation $this->db->select (...) in mysql.class.php

1. Enquiry
$this->select ($where = ', $data = ' * ', $limit = ', $order = ', $group = ', $key = ') returns an array of result sets
condition, field (Id,name,email ...), sort by, group by, sort by name


2. Querying multiple data and paging

listinfo ($where = ', $order = ', $page = 1, $pagesize =, $key = ', $setpages = ten, $urlrule = ', $array = array ())

3. Get a single record query

get_one ($where = ', $data = ' * ', $order = ', $group = ')

4. Execute SQL query directly

query ($sql);

5. Get the primary key number of the last record added insert_id ()

6, perform Update record action update ($data, $where = ") $data suggested array, $where can be a string for the array

7. Perform Delete record operation Delete ($where)

8. Count the number of records counted ($where = ")

9. Gets the number of bars affected by the last database Operation Affected_rows ()

10. Get data Table primary key get_primary ()

11. Get table field get_fields ($table _name = ")

12, check whether the table exists table_exists ($table)

13. Check if the field exists field_exists ($field)

Phpcms V9 Database operation function

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.