Home  >  Article  >  Backend Development  >  Summary of PHP PEAR DB class functions_PHP tutorial

Summary of PHP PEAR DB class functions_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:33:51936browse

PHP PEAR DB class function description:

connect(): database link function

query(): SQL statement Execution function

execute(): SQL statement execution function, which is slightly different from the query() function.

setFetchMode(): Set whether the returned record set is a numeric index array, an associative array or an object

numRows(): Return the number of rows in the record set

numCols(): Returns the number of columns in the record set

free(): Releases the record set

disconnect(): Closes the database link

affectedRows(): The number of record rows affected by the operation

isManip(): Determine whether a query is a data processing or data definition operation

Platform porting instructions:

Ideally, when porting to other types of database platforms, only modifications are needed The DSN string parameter in the PHP PEAR DB class function is sufficient, but for some queries unique to specific databases, they can only be modified when transplanted to other database platforms.

Others:

The DB directory stores all related databases supported by PHP PEAR DB class functions. Interested friends can take a look.

Through the above code examples, we can use the PHP PEAR DB class to implement the access functions of different databases.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446031.htmlTechArticlePHP PEAR DB class function description: connect(): database link function query(): SQL statement execution function execute( ): SQL statement execution function, which is slightly different from the query() function. setF...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn