解决The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

在php5.3环境下,写了一个脚本,放到php5.6环境中直接错误:Deprecated: mysqlconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead,意思是说要用mysqli或者PDO来替代mysql,mysql_将在未来弃用。

解决方法1:

解决方法2:

在php程序代码里面(或在服务器php配置文件中)设置报警级别

Deprecated的问题到此已解决。

https://blog.wanxiaohong.cn/avatar/.jpg"/avatar/42f421c90cdddbf19e471ec93d857d82?s=128&d=mm" class="avatar avatar-128" height="128" width="128">

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: