Home > Backend Development > PHP Tutorial > PHP数据库mysqli连接的有关问题

PHP数据库mysqli连接的有关问题

WBOY
Release: 2016-06-13 12:04:12
Original
1239 people have browsed it

PHP数据库mysqli连接的问题。
我看了一下连接方式,面向过程的话,几乎和mysql-connect连接的方式差不多,

有个问题想问问

据说mysql_connect的连接是非持久连接,所以一般可以省略不写mysql_close()

据说mysqli_connect的连接是持久性的,那么可以省略不写mysqli_close()吗???
------解决方案--------------------
小白学习中,用的是pdo进行连接数据库
------解决方案--------------------
mysqli打开持久化连接要在连接时在主机名前增加p:
而mysql则要用特定的函数mysql_pconnect来实现
所以,还是要看你自己打开的是持久连接还是非持久连接来close吧

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template