题目内容

mysql数据库地址为localhost,登录名为root,登录密码为12346,要连接的数据库名为yzdata

A. $con=mysqli_connect('yzdata','root','123456','localhost');
B. $con=mysqli_connect('localhost','root','123456','yzdata');
C. $con=mysqli_connect('localhost','123456','root','yzdata');
D. $con=mysqli_connect('localhost','root','yzdata','123456');

查看答案
更多问题

php执行sql语句的函数是

A. mysql_connect()
B. mysql_query()
C. mysqli_connect()
D. mysqli_query()

以下能正常执行sql的代码是$con=mysqli_connect('localhost','root','123456','yzdata');$sql="select * from userinfo";

A. $result=mysqli_query($sql,$con);
B. $result=mysql_query($con,$sql);
C. $result=mysqli_query($con,$sql);
D. $result=mysqli_close($con,$sql);

能关闭以下数据库连接的代码是$con=mysqli_connect('localhost','root','123456','yzdata');

A. mysql_close($con);
B. mysqli_close($con);
C. mysql_close();
D. mysqli_close();

$user=$_POST['username'];//账号$pwd=$_POST['password'];//密码数据库userinfo表中保存账号和密码字段分别是username和pasword,则查询账号和密码是否正确的sql语句是select * from ________ where __________ and _________;

答案查题题库