今天使用了mysql 5.5版本,就出现了错误。错误提示如下:

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in

看意思就很明了,说mysql_connect这个模块将在未来弃用,请你使用mysqli或者PDO来替代。所以说这个应该说是提示更恰当。

现在知道这个错误是什么原因引起的,那么就很好解决了。

解决方法1:在php程序代码里面设置报警级别

<?php
error_reporting = E_ALL & ~E_DEPRECATED

 

方法2:禁止php报错

display_errors = On 改为 display_errors = Off

方法3:使用mysqli或者PDO

建议大家尽快取消mysql,全部都走向mysqli或者PDO等等。mysql确实是太不安全而且太老旧了。

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2021-08-15
  • 2021-09-06
  • 2021-08-15
  • 2022-12-23
猜你喜欢
  • 2021-10-10
  • 2022-12-23
  • 2021-11-19
  • 2021-08-25
相关资源
相似解决方案