PHP must first connect to the specified database to operate the database. The mysql_connect function we used before is no longer supported by some PHP versions. Currently, the editor uses the mysqli_connect function to link to the database. The usage is the same as mysql Basically similar.
Recommended related mysql video tutorials: "mysql tutorial"
This article introduces how to use the mysqli_connect function and examples. Friends who need it can refer to it.
1. php mysqli operation mysqli_connect connection database instance detailed explanation
Introduction: Detailed explanation of mysqli_connect connection database instance
2. mysqli_connect: HY000/2002: Permission denied
Introduction ::This article mainly introduces mysqli_connect: HY000/2002: Permission denied. Students who are interested in PHP tutorials can refer to it.
Introduction: {Code...} Error: {Code...} But there is no problem using the object-oriented method. What is the problem?
4. PHP connects to the database and reads data and prints
Introduction:: This article mainly introduces PHP Connect to the database and read the data for printing. Students who are interested in PHP tutorials can refer to it.
Introduction: Connect to the database: PHP 5619 connects to the database: PHP5.3 and above versions do not recommend using mysql_connect, mysql_query and other functions, and use the mysqli series (improved) instead. This is an example of connecting to a database and querying data.
Introduction: Mysql, model: PHP implements a complete example of the Model base class based on mysqli: This article describes the example of PHP implementing the Model base class based on mysqli and shares it with you for your reference. The details are as follows: DB.class. .php
7. first day of my life php is_file and is_dir are used to traverse the directory usage precautions
Introduction: first day of my life :first day of my life php is_file and is_dir usage notes when traversing directories: 1. Directory inc has the following contents: subdirectory 0 subdirectory a footer.html header.html login_function.inc.php mysqli_connect.php style.css 2. Now PHP needs to traverse the inc directory and only display files, not directories 0 and a. The code is as follows: Copy the code as follows: $dir = $_SERVER['DOCUMENT_R
8 . mysql mysql_error mysqli_connect_error garbled code
Introduction:: mysql mysql_error mysqli_connect_error garbled code:
##9. php is_file() and is_dir() usage precautions when traversing directories_PHP tutorial
Introduction: Notes on usage when php is_file() and is_dir() are used to traverse directories. 1. The directory inc has the following contents: Subdirectory 0 subdirectory a footer.html header.html login_function.inc.php mysqli_connect.php style.css 2. Now PHP needs to traverse the inc directory and only display files
10. PHP5 connects to mysql data class_PHP tutorial
Introduction: PHP5 connects to mysql data class. @ $db = new mysqli_connect(host, username, password, database name); //Connect to the database $sql = ""; $result = $db-query($sql); //Execute sql statement $num_results = $result -unm_rows; //Return rows
[Related Q&A recommendations]:
php - Is there an alternative to mysql_result()
PHP5.6.9+APACHE2.4.12+MySql5.5 Manual configuration environment mysqli_connect is not available .
Single point of failure - mysql cluster usage problem
php-fpm cannot connect to mysql?
The above is the detailed content of 10 recommended content of mysqli_connect. For more information, please follow other related articles on the PHP Chinese website!