请帮我找出PHP中的错误并改正,谢谢!

来源:百度知道 编辑:UC知道 时间:2024/05/12 01:01:56
运行后显示:
Parse error: syntax error, unexpected T_STRING in F:\Appserv\www\h4.php on line 15
请帮我找出错误并改正,谢谢!
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="">
<p class="style1">1.学生考试情况如下:</p>
<?php $host="localhost"; $user="root"; $password="123456";
$dbase_name="jxgl"; $table_name="xsqk,kcml,kscj";
$conn=mysql_connect($host,$user,$password) or die ("连接MySQL服务器失败。".mysql_error( ));

$mysql_command="select xsqk.学号,姓名,课程名称,考试成绩 from ".$table_name where kscj.学号 = xsqk.学号 AND kscj.课程号 = kcml.课程号 ;

改成

$mysql_command="select xsqk.学号,姓名,课程名称,考试成绩 from $table_name where kscj.学号 = xsqk.学号 AND kscj.课程号 = kcml.课程号" ;

下引号引错地方了.很多字符在引号之外了.

echo "<td>$record[学号]</td>";
echo "<td>$record[姓名]</td>";
echo "<td>$record[课程名称]</td>";
echo "<td>$record[考试成绩]</td></tr>";

这里说明一下,没有人会拿中文当数组索引的(同样也不会有人用中文做为数据库的字段名),匹配的效率太低下了.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>