小胖学PHP总结5-----PHP操作SQL数据库(Deprecated: mysql_connect(): The mysql extension is deprecated and will)
来源:互联网 发布:mac上怎么用搜狗输入法 编辑:程序博客网 时间:2024/06/09 22:50
第一:打开数据库
要操作SQL数据库,首先必须于MySQL服务器建立连接,连接MySQL服务器的语句:
mysql_connect('hostname','username','password')该函数的返回值用于表示这个数据库连接成功,如果连接成功,则会返回一个资源,为以后执行SQL指令做准备。
<?php$link = mysql_connect("localhost:3306","root","123456") or die("不能连接到数据库服务器,可能数据库服务没有启动或者用户名密码错误!");if ($link) {echo "数据库连接成功!";}?>
第二:出现错误(警告)
但是,我在测试的时候,会出现这样的情况: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来替代。
欢迎大家一起交流学习,O(∩_∩)O哈哈哈~
0 0
- 小胖学PHP总结5-----PHP操作SQL数据库(Deprecated: mysql_connect(): The mysql extension is deprecated and will)
- 解决PHP中Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the futu
- php 报: 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the f
- 解决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
- 解决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: us
- 解决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:
- 给TextView中的部分文本添加链接的两种方式
- AD 软件使用心得记录
- go 操作mysql、增删改查
- hdu 1002 A + B Problem II
- 初识双网卡
- 小胖学PHP总结5-----PHP操作SQL数据库(Deprecated: mysql_connect(): The mysql extension is deprecated and will)
- CNTV视频回看下载地址
- 验证码短信接口可以广泛应用在网站会员手机验证、APP应用手机验证、订单通知、物流提醒等触发类短信应用。
- 完整java开发中JDBC连接数据库代码和步骤
- windchill学习之action的filter注册
- android listview 属性介绍
- 【HDU】5304 Eastest Magical Day Seep Group's Summer【环dp+生成树计数】
- virbr0 虚拟网卡卸载方法-技术宅-ChinaUnix博客
- struts <s:action>标签的用法