2015-3-18 学习出错问题解决--PHP Deprecated问题
2015-03-19 09:47
309 查看
系统:windows 10 10036
环境:Apache2.4 + php 5.6.5 + mysql 5.5
学习内容:PHP连接数据库 分别有mysqli mysql
出现的问题 :
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in D:\wamp\www\0316\phpdev_connect.php on line8
解决办法:
一、
禁止php报错:
display_errors = on
改为
display_error = off
二、
在代码里添加:
error_reporting(E_ALL ^E_DEPRECATED);
三、
hod to solve the warnings?
currently mostly many mysql connection in php use this construct
mysql:
$link = mysqli_connect('localhost','user','password','dbname');
To run databae queries is also simple and nearly identical with the old way:
filthy and fastest solutin:
环境:Apache2.4 + php 5.6.5 + mysql 5.5
学习内容:PHP连接数据库 分别有mysqli mysql
出现的问题 :
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in D:\wamp\www\0316\phpdev_connect.php on line8
解决办法:
一、
禁止php报错:
display_errors = on
改为
display_error = off
二、
在代码里添加:
error_reporting(E_ALL ^E_DEPRECATED);
三、
hod to solve the warnings?
currently mostly many mysql connection in php use this construct
mysql:
$link = mysql_connect('localhost','user','password'); mysql_select_db('dbname',$link);mysqli:
$link = mysqli_connect('localhost','user','password','dbname');
To run databae queries is also simple and nearly identical with the old way:
//old mysql_query('create temporary table `table`',$link); //new msyqli_query($link,'create temporary table `table`');
filthy and fastest solutin:
<?php error_reportion(E_ALL ^E_DEPRECATED);
相关文章推荐
- 解决php 5.3 deprecated 错误问题
- 解决 PHP 加载 dll 模块出错的问题
- 韩顺平_PHP程序员玩转算法公开课(第一季)05_使用单链表解决约瑟夫问题_学习笔记_源代码图解_PPT文档整理
- PHP慢慢长路之问题与解决方法(2)――用navicat导出数据库出错问题解决
- 关于PHP转换超过2038年日期出错的问题解决
- 解决NGINX+PHP-FPM failed to ptrace(PEEKDATA) Input/output error出错问题
- PHP 解决版本问题:"Assigning the return value of new by reference is deprecated"
- 解决php deprecated 的问题
- 解决NGINX+PHP-FPM failed to ptrace(PEEKDATA) Input/output error出错问题
- 学习日记-解决PHP时间戳中月份、日期前带不带0的问题
- 解决php deprecated 的问题
- 学习php需要了解的点4 - PHP中file_get_contents函数抓取https地址出错的解决方法
- .NET代码混淆学习和解决视频批量转换中.wmv转换出错问题
- PHP5.3开发-解决DEPRECATED错误问题
- php学习笔记数组与数据结构1(日期时间函数及遇到的问题解决)
- PHP学习之路之PHP文件上传需要考虑的问题以及解决方法($_FILES,$_SERVER,substr,strrpos,file_exists,move_uploaded_file,is_uploaded_file,mkdir)
- sqlserver -- 学习笔记(三)解决php连接sqlserver2005视图时显示“异类查询要求为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项”的问题
- php5.5.15注释问题PHP Deprecated: Comments starting with '#' are deprecated in *.ini 警告解决办法
- git学习--git push出错问题的解决
- 解决NGINX+PHP-FPM failed to ptrace(PEEKDATA) Input/output error出错问题