基于PHP的Web数据库访问
print(“〈html〉〈head〉\n”);?
本文链接地址:http://www.oyaya.net/fanwen/view/140544.html
print(“〈title〉成绩查询〈/title〉〈/head〉\n”);?
print(“〈body〉〈cennter〉”);?
print(“〈font size=6 color=”ff0000〉您的成绩如下〈/font〉”);?
$comm=mysql_connect(“localhost”,“root”,"");?
mysql_select_db(“Score”,$comm);?
$str=“Select *From Score Where stu_no=’$pstu_no'and name=’$pname'”;?
$reault=mysql_query($str,$comm);?
print(“〈table align=center〉”);?
$sqlrow=mysql_fetch_row($result));?
print(“学号:$sqlrow[0]”);?
print(“姓名:$sqlrow[1]”);?
print(“成绩1:$sqlrow[2]”);?
print(“成绩2:$sqlrow[3]”);?
print(“〈/table〉〈body.〈/html〉”);?
?〉?
2) 通过ODBC访问MySQL数据库的代码如下(省略的代码同上):?
〈?php?
…?
$comm=odbc_connect(“Score”,"system","");?
$str
《基于PHP的Web数据库访问(第6页)》