PHP错误原因 20
Parseerror:syntaxerror,unexpected''(T_ENCAPSED_AND_WHITESPACE),expectingidentifier(T_...
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
代码:
<?php
$dsn="mysql:host:localhost;dbname=system";
$db=new PDO($dsn,'root','');
$db->query('set names utf-8');
$result=$db->query('select * from class_study');
?>
<table>
<tr>
<th>学号</th>
<th>姓名</th>
<th>课程编号</th>
<th>考核成绩</th>
<th>考试日期</th>
</tr>
<?php while($row=$result->fetch()){?>
<tr>
<td><?php echo ".$row['id']";?></td>
<td><?php echo ".$row['name']";?></td>
<td><?php echo ".$row['class_id']";?></td>
<td><?php echo ".$row['score']";?></td>
<td><?php echo ".$row['exam_time']";?></td>
</tr>
<?php }?> 展开
代码:
<?php
$dsn="mysql:host:localhost;dbname=system";
$db=new PDO($dsn,'root','');
$db->query('set names utf-8');
$result=$db->query('select * from class_study');
?>
<table>
<tr>
<th>学号</th>
<th>姓名</th>
<th>课程编号</th>
<th>考核成绩</th>
<th>考试日期</th>
</tr>
<?php while($row=$result->fetch()){?>
<tr>
<td><?php echo ".$row['id']";?></td>
<td><?php echo ".$row['name']";?></td>
<td><?php echo ".$row['class_id']";?></td>
<td><?php echo ".$row['score']";?></td>
<td><?php echo ".$row['exam_time']";?></td>
</tr>
<?php }?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询