多年来,我一直在检查此代码,试图找出导致此错误的原因。它说的是意外的 T_ELSE,它指向代码中的最后一个 else。有人可以指出我的错误。非常感谢
<?php
error_reporting(E_ALL);
// AFTER SUCCESSFUL QUERY
if (mysql_num_rows() == 0)
{
echo '<div class="no-rec">No Record Found !</div>';
}
else
{
while ($row = mysql_fetch_assoc($rsd))
{
$ticket = $row['ticket_frm'];
$rowdate = date("d/m/Y",strtotime($row['date_frm']));
$id = $row['id_frm'];
$from = $row['from_frm'];
$subject = $row['subject_frm'];
$message = $row['message_frm'];
$myString = <<<ENDMYSTRING
<div class="each_rec">
<div class="record blue" data-message="$message" data-subject="$subject" data-rowdate="$rowdate" data-from="$from">
<img src="images/sml_new_mail_icon.gif" class="mailIcon" alt="" /><span class="iconSubject">$subject</span>
<div class="rowdate">$rowdate</div>
<span class="mailFrom">$from</span>
</div>
<br />
ENDMYSTRING;
echo $myString;
}
}
else
{
echo 'you must enter a ticket#';
//$sql = "select * from contact_frm";
//var_dump(mysql_error());
}
?>