php中@mysql_connect与mysql_connect有什么区别

Posted hnqyliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php中@mysql_connect与mysql_connect有什么区别相关的知识,希望对你有一定的参考价值。

屏蔽错误
如果有错的话,会把语句都显示出来。
加@就不显示
[email protected]_connect(‘localhost‘,‘root‘,‘123‘) or die ("数据库连接失败");

这样写最好
如果失败(or die )显示 “数据库连接失败” 字样





以上是关于php中@mysql_connect与mysql_connect有什么区别的主要内容,如果未能解决你的问题,请参考以下文章

mysql_connect() 总是拒绝访问

常用mysql函数

mysql_connect() 中的 localhost 与 127.0.0.1

mysql_connect() 中的 localhost 与 127.0.0.1

php mysql_connect()

PHP PDO 与普通 mysql_connect