解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
2014-07-01 15:14
309 查看
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报错
display_errors = On |
改为 |
display_errors = Off |
解决方法2:
常用的php语法连接mysql如下
<?php |
$link = mysql_connect( 'localhost' , 'user' , 'password' ); |
mysql_select_db( 'dbname' , $link ); |
改成mysqi |
<?php |
$link = mysqli_connect( 'localhost' , 'user' , 'password' , 'dbname' ); |
<?php |
// 老的 |
mysql_query( 'CREATE TEMPORARY TABLE `table`' , $link ); |
// 新的 |
mysqli_query( $link , 'CREATE TEMPORARY TABLE `table`' ); |
在php程序代码里面设置报警级别
<?php |
error_reporting (E_ALL ^ E_DEPRECATED); |
转载请注明出处:http://www.ttlsa.com/html/2502.html
版权说明
文章标题: 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO insteadin
本文地址: http://www.ttlsa.com/php/deprecated-mysql-connect/
除非注明,博客文章均为"运维生存时间"原创,转载请标明本文地址
相关文章推荐
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: