Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in E:ampapachehtdocsprodviewcat.php on line 22
遇到这个错误,上网也没找到答案,麻烦你们能帮帮我解决哈,忠心感谢。
我的代码:
<?php
require("config.php");
if(isset($_GET['id'])==TRUE){
if(is_numeric($id)==FALSE){
$error=1;
}
if(isset($error)&&$error==1){
header("Location:".$config_basedir."/viewcat.php");
}
else{
$validcat=$_GET['id'];
}
}
else{
$validcat=0;
}
$sql="SELECT * FROM categories";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result)){
if($validcat==$row['id']){
echo "<strong>".$row['cat']."</strong><br/>";
$entriessql="SELECT * FROM entries WHERE cat_id=".$validcat.
"ORDER BY dateposted DESC;";
$entriesres=mysql_query($entriessql);
$numrows_entries=mysql_nums_rows($entriesres);
echo "<ul>";
if($numrows_entries==0){
echo "<li>No entries!</li>";
}
else{
while($entriesrow=mysql_fetch_assoc($entriesres)){
echo "<li>".date("D jS F Y g.iA",strtotime($entriesrow['dateposted']))."- <a href='viewentry.php?id=".$entriesrow['id']."'>".$entriesrow['subject']."</a></li>";
}
}
echo "</ul>";
}
else{
echo "<a href='viewcat.php?id=".$row['id']."'>".$row['cat']."</a><br/>";
}
}
require("footer.php");
?>
------解决方案--------------------
$entriessql="SELECT * FROM entries WHERE cat_id=".$validcat.
"ORDER BY dateposted DESC;";
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群