Code Analysis Learning for Discuz (iii) MySQL driver

Source: Internet
Author: User
Tags throw exception

I. Attribute analysis
1.tablepre: Table name prefix
2.version: Database version
3.drivertype: Drive Type
4.querynum: Number of Queries
5.curlink: Current Connection
6.link: Storage Connection Resources
7.config: Configuration Items
8.sqldebug:sql Commissioning
9.slaveid: I don't know.
10.map: I don't know.

Two. Method analysis1.db_mysql: Configuring the driver
2.set_config: Configuring the driver
3.connect: Connect to Database
4._dbconnect: The underlying code of the previous method
5.table_name: I don't know.
6.select_db: Selecting a Database
7.fetch_array: Getting the result set as an array
8.result_first: Getting the first piece of data from the result set
9.query: Execute SQL statement
10.affected_rows: Gets the number of record rows affected by the most recent insert,update or DELETE query associated with Link_identifier.
11.error: Return database error message
12.errno: return error number
13.result: Get the row data specified in the result set
14.num_rows: Returns the number of rows in the result set.
15.num_fields: Returns the number of fields (columns) in the result set
16.free_result: The function frees the resulting memory. Returns true if successful, or False if it fails.
17.insert_id: Last inserted data ID
18.fetch_row: Getting the result set as an indexed array
the 19.fetch_fields:mysql_fetch_field () function obtains column information from the result set and returns it as an object.
20.version: Returns the current database version
21.escape_string:mysql_escape_string This method is used to escape characters and is deprecated in PHP5.322.close: Close Connection
23.halt: Throw exception
24.fetch_first: Get the first piece of data

Code Analysis Learning for Discuz (iii) MySQL driver

Related Article

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.