What should I do if php mysql_connect is not supported?

藏色散人
Release: 2023-03-05 18:04:01
Original
3258 people have browsed it

php mysql_connect is not supported because PHP7 no longer supports the "mysql_connect" function. This function is an obsolete function and needs to be replaced by MySQLi or PDO_MySQL extension.

What should I do if php mysql_connect is not supported?

Recommended: "PHP Video Tutorial"

mysql_connect() php7 does not support it, php5.5 does, yes Abandoned function

I have been using PHP7 for days and found that there are quite a lot of changes compared to PHP5. The biggest one is that the MySQL connection library has changed.

The mysql_connect() function is used in PHP5 to connect, but in fact, starting from PHP5.5, MySQL is no longer recommended and is an abandoned function.

It seems that it is no longer supported in PHP7. According to the official website, they are replaced by the following two:

This extension has been deprecated since PHP 5.5.0 and will be removed in the future. It should be replaced with the MySQLi or PDO_MySQL extension. See the MySQL: Choosing an API guide and related FAQ for more information. Alternatives to this function are:

mysqli_connect()

PDO::__construct()

When using, do not use mysql_connect, you can use mysqli_connect() instead , the usage is basically similar, it is said to be an object-oriented library.

In php.ini, there is only extension=php_mysqli.dll, and there is no longer extension=php_mysql.dll.

The above is the detailed content of What should I do if php mysql_connect is not supported?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!