此腳本顯示我請求(ID,DSC,學院)的數據,但即時得到錯誤第20行PHP腳本 - 意外「}
{
if ($row['suspended']==1){
解析錯誤:語法錯誤,意想不到的‘}’ C:\ WAMP \ WWW \頁免費\腳本\上線meminclude.php 20
<?php
include("dbconnect1.php");
$query = "SELECT id,dsc, school FROM module WHERE dsc LIKE '%%%s%%'";
$link = @ mysql_query($query);
if (!$link) {
header("location:../account/account.master.php?page=invalid&errorcode=1");
die();
}
$i=0;
$status="";
while ($row = mysql_fetch_array($link, MYSQL_ASSOC))
{
if ($row['suspended']==1){
$status="SUS";
}
echo "
<tr id='row$i' class='trows'>".
"
<td id='id$i'>".$row['id']."</td>".
"
<td id='dsc$i'>".$row['dsc']."</td>".
"
<td id='school$i'>".$row['school']."</td>".
"
</td>".
"
<td><input type='radio' name='whome' id='showMe$i' onclick='showMem($i)' /></td>
";
if ($status=='SUS'){
echo "
<td><input type='radio' name='suspend' checked='checked' disabled='disabled' /></td>
";
} else {
echo "
<td><input type='radio' name='suspend' id='suspend$i' onclick='suspendMem($i)' /></td>
";
}
echo "
<td><input type='radio' name='delete' id='delete$i' onclick='deleteMe($i)' /></td>
".
"
<td id='status$i'>".$status."</td></tr>";
$i++;
$status="";
}
?>
腳本此處引用:
<script type="text/javascript">
$(document).ready(function() {
var numrecs=$(".trows").length;
var me= $('#th1').html()+" - "+(numrecs)+" Records in Table.";
$('#th1').html(me);
RiVm=numrecs;
});
</script>
<link rel="stylesheet" href="../css/results.css" type="text/css" />
<div id="appleft">
<form id="myapprovelist" method="post">
<fieldset style="border:none">
<table id="myTable">
<tr><th id="th1" colspan="10">Active Membership List</th></tr>
<tr class="red">
<th>ID</th>
<th>DSC</th>
<th>School</th>
</tr>
<?php include("../scripts/meminclude.php")?>
</table>
</fieldset>
</form>
</div>
<div id="appright">
<img id="theBroon" src="" alt="" /><br />
<span id="myBroon"></span>
</div>
</div>
<div style="clear:both">
</div>
你應該對自己的修正瑣碎的分析錯誤,不開這樣的主題對這些錯誤進行排序。 – 2012-07-19 10:42:57
它看起來不錯,粘貼'dbconnect1.php'代碼。 – rogal111 2012-07-19 10:43:17
showMem($ i)改爲showMem({$ i}) – 2012-07-19 10:45:19