Home >Backend Development >PHP Tutorial >PHP linked database

PHP linked database

WBOY
WBOYOriginal
2016-08-08 09:24:54814browse

PHP links MySql database
mysql_connect('server','username','password')
mysql_connect() returns the identification of successful database connection.
mysql_slect_db('database name','link')
mysql_slect_db() selects the library used,
mysql_query("sql statement") sql statement can add, delete, modify and query
mysql_query() method of executing sql statement.
mysql_fetch_array ('results from the incoming sql query') returns key/value pairs and index/values ​​
mysql_fetch_assoc ('results from the incoming sql query') only returns key/value pairs
mysql_num_rows() returns the sql query results Head Office

The above has introduced the PHP link database, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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