<?php header("content-type:text/html;charset=utf-8"); $mq=mysqli_connect('localhost','root',''); if(!$mq){ echo "链接失败"; } else{ echo "链接成功"; } if(mysql_query("CREATE DATABASE animal",$mq)){ echo "创建成功"; }else{ echo "创建失败"; }?>错因: Warning: mysql_query() expects parameter 2 to be resource, object given in D:\WAMPServer\wamp\www\phptext\phptext1\mysqltext.php on line10
1 回答
KevenHuang
TA贡献280条经验 获得超233个赞
第三行写错了$mq=mysqli_connect('localhost','root','');用mysqli扩展连接的数据库却用了mysql_query能不错吗?
- 1 回答
- 0 关注
- 2808 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消