Home  >  Article  >  Backend Development  >  php连接mysql,该如何解决

php连接mysql,该如何解决

WBOY
WBOYOriginal
2016-06-13 12:26:24989browse

php连接mysql
@$db= new mysqli (“localhost”,“bookorama”,“mima123”,“books”);
请问这个链接到数据库的语句中是实例化了一个mysqli类吗?mysqli记得是一个函数库啊,这里怎么成了类啊???$db这个产量可以用吗?
------解决思路----------------------
是实例化了一个mysqli类,可以使用$db,$db是一个资源类型变量
------解决思路----------------------
可以用的,也支持面向对象化
------解决思路----------------------
php_mysqli 扩展本身就提供有两种工作方式:分立函数 和 面向对象
但在使用时需注意的是:不能混用

Statement:
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