解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
来源:互联网 发布:聚氨酯 js聚合物 编辑:程序博客网 时间:2024/04/30 00:24
解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
php 5个版本,5.2、5.3、5.4、5.5,怕跟不上时代,新的服务器直接上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报错
display_errors = On
改为
display_errors = Off
鉴于这个服务器都是给用户用的,有时候他们需要报错(…都是给朋友用的,^_^),不能这做,让他们改程序吧,看方案2.
解决方法2:
常用的php语法连接mysql如下
<?php
$link
= mysql_connect(
'localhost'
,
'user'
,
'password'
);
mysql_select_db(
'dbname'
,
$link
);
改成mysqi
<?php
$link
= mysqli_connect(
'localhost'
,
'user'
,
'password'
,
'dbname'
);
常用mysql建表SQL如下
<?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
0 0
- 解决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:
- 解决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:
- 解决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: u
- log4j的使用
- nodejs中基于TCP协议时下的类IRC程序(中继聊天程序)
- PAT (Advanced Level) Practise 1002. A+B for Polynomials (25)
- 【转】大道无形 难以揣摩的苹果商店审核制度
- SQL Server 2008中文版标准教程读书笔记 ADO.NET(复习SQL Server 九)
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 总线错误和段错误问题的定位
- cocos2dx 3.x 自学笔记 <一> :cocos2dx 3.X 中的回调
- 《iOS7 by Tutorials》系列:iOS7的设计精髓(上)
- logstash源码分析
- package-info.java
- ubuntu10.10 root用户取消禁用 并设置密码,显现在登陆界面
- iOS-Block使用注意点
- SVN上传.so文件