Home >Backend Development >PHP Tutorial >PHP linked database
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.