题目内容:
下面的程序可实现查询xuefen为6的第二条记录,并将课程名在网页上显示出来,将程序补充完整<?php
$con=__________________(“localhost:3306”,”root”,”123456”) or die(“数据库服务器连接失败!<br>”);
__________________(“sxcj”,$con) or die(“数据库服务器选择失败!<br>”);
mysql_query(“set names ‘gbk’”);
$sql=”SELECT * FROM kc”;
$sql=$sql.”WHERE xuefen=6”;
$result=__________________($sql,$con);
If(___________________)
{echo “查询成功!<br>”;
if(_____________________($result,______))
{$array=_____________________($result,MYSQL_NUM);
echo “学分为6的课程表中第2条课程名是 :”______________________;
}else echo “记录定位失败!<br>”;
}else echo “查询失败!<br>”;
?>
参考答案:
答案解析: