【发布时间】:2015-08-25 01:17:46
【问题描述】:
解析错误:语法错误,第 22 行 C:\xampp\htdocs\ad10.php 中的文件意外结束
<?php
$c=mysql_connect("localhost","root","") or die("Connection Error");
mysql_select_db("staff") or die("database error");
$q=mysql_query("select * from teachers");
echo "<table border=1>
<th>Number</th>
<th>Name</th>
<th>Shift</th>
<th>Class</th>
<th>Update</th>
<th>Remove</th>";
while($row=mysql_fetch_array($q))
{
?>
<tr>
<td><? echo $row['Name'];?></td>
<td><? echo $row['Shift'];?></td>
<td><? echo $row['Class'];?></td>
</tr>
<?
}
?>
</table>
任何人都可以请通知代码的问题.....
【问题讨论】:
-
在选择数据库、mysql_select_db("staff",$c) 或 die("database error") 中插入您的连接;