: This article mainly introduces the PHP link database. if you are interested in the PHP Tutorial, you can refer to it. Link PHP to MySql database
Mysql_connect ('server', 'username', 'password ')
Mysql_connect () returns the ID of a successful database connection.
Mysql_slect_db ('database name', 'link ')
Mysql_slect_db () select the database used,
Mysql_query ("SQL Statement") SQL statements allow addition, deletion, modification, and query
Mysql_query () method for executing SQL statements.
Mysql_fetch_array ('results of SQL queries passed in ') return key/value pair and index/value
Mysql_fetch_assoc ('results of SQL queries passed in ') returns only key/value pairs
Mysql_num_rows () returns the total line of the SQL query results
The above introduces the PHP link database, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.