In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you the "php7 connection mysql failure solution", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn the "php7 connection mysql failure solution" this article.
Php7 failed to connect to mysql because php7 has abandoned the mysql_connect function, the solution: 1, use mysqli_connect () function to connect; 2, use object-oriented method to connect mysql.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
What if php7 fails to connect to mysql?
Reason:
Php5 uses the mysql_connect function to connect to the Mysql database, but you will find that this method does not work on php7. The reason is simple: php7 has abandoned this function, and now php7 probably uses two ways to connect to the MySQL database.
Method 1:
Using function concatenation, the original mysql_connect () is changed to the mysqli_connect () function, and everything is fine by adding this letter.
Syntax: variable name = mysqli_connect (host address, user name, password, database name)
Method 2:
Use an object-oriented approach.
Syntax:
Variable name = new mysqli (host address, user name, password, database name)
The above is all the contents of this article entitled "the solution to the failure of php7 connection to mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.