帮助看看 Parse error 多谢!!!!

elite2018 2002-01-31 07:35:55
帮助看看 Parse error
Parse error: parse error in c:\apache\htdocs\9州cor\mp\new\mp\fy.php on line 173

源代码:<?
if ($hangye =='- °´ÐÐÒµ -' || $hangye =='¹¤ÒµÀࣺ' || $hangye =='ũҵÀࣺ' ) $hangye='';
if ($area =='- °´µØÓò -' ) $area='';
if ($nianxian =='- °´ÄêÏÞ -' ) $nianxian='';
if ($price =='- °´ÖÊÁ¿½± -' || $price =='ÆóÒµ½±£º' || $price =='²úÆ·½±£º' || $price =='¸öÈ˽±£º') $price='';
if ($name =='£­ÊäÈëÆóÒµÃû³Æ£­' ) $name='';
if ($chanpin =='£­ÊäÈë²úÆ·Ãû³Æ£­' ) $chanpin='';
//echo $hangye."<br>"; ²âÊÔʹÓÃ
//echo $area."<br>";
//echo $nianxian."<br>";
//echo $price."<br>";
///echo $name."<br>";
//echo $chanpin."<br>";
if ($hangye == ''& $area == '' & $nianxian == ''&$price== ''&$name == '' & $chanpin =='')
{
$sql='wrong';
}
else
{
if ($hangye !='' and$hangye != '²»ÏÞ')
{
$tempsql=$tempsql.' hangye='.'"'.$hangye.'"'." and";
}
else
{
$tempsql=$tempsql;
}
if ($area !='' and $area != '²»ÏÞ')
{
$tempsql=$tempsql.' area='.'"'.$area.'"'." and";
}
else
{
$tempsql=$tempsql;
}
if ($nianxian !='' and $nianxian != '²»ÏÞ')
{
$tempsql=$tempsql.' nianxian='.'"'.$nianxian.'"'." and";
}
else
{
$tempsql=$tempsql;
}
if ($price !='' and $price != '²»ÏÞ')
{
$tempsql=$tempsql.' price='.' "'.$price.'"'." and";
}
else
{
$tempsql=$tempsql;
}
if ($name !='' )
{
$tempsql.=' name like '.'\'%'.$name.'%\'';
}
else
{
$tempsql=$tempsql;
}
if ($chanpin !='' )
{
$tempsql=$tempsql.'and chanpin like'.'\'%'.$chanpin.'%\'';
}
else
{
$tempsql=$tempsql;
}


//if ($chanpin !='' ) $tempsql=$tempsql.'chanpin='.$chanpin;
//echo "1".$tempsql."<br>";
if ($tempsql == '')
{
$sql='wrong';
}
else
{
if (substr($tempsql,strlen($tempsql)-5,strlen($tempsql)) == "and") $tempsql=substr($tempsql,0,strlen($tempsql)-3);
//echo "3".$tempsql."<br>";
//µÃµ½Ô­Ê¼Óï¾äsql
$sqlstart = "select * from mp where ".$tempsql;


//echo $sqlstart

//echo $sqlstart;
// echo $sqlstartid;
}


require ("moban1.inc");
echo "<br>\n";
echo "<br>\n";

if ($sqlid == '') $sqlid = $sqlstartid;

//Á¬½ÓÊý¾Ý¿â

require ("conn.php");

$query_result = mysql_query($sqlstart,$db);

$num = mysql_num_rows($query_result);
$page_num = 2;
$pages=ceil($num/$page_num);
$current_page=$offset/$page_num+1;

$current_page=$offset/$page_num+1; // µ±Ç°Ò³Êý

//ËÑË÷ûÓÐÕÒµ½£¬·µ»Ø´íÎóÐÅÏ¢
if ($num == 0) {
print("<table width=\"100%\" bgcolor=\"#ffffff\" cellpadding=\"1\" cellspacing=\"1\">");
print("<tr>");
print(" <td height=\"25\" bgcolor=$DARKCOLOR align=\"center\"><div class=\"smallfont\"><font color=\"#ffffff\"><b>´íÎóÐÅÏ¢£¡</b></font></div></td>");
print("</tr>");
print("<tr>");
print(" <td height=\"30\" bgcolor=$MEDIUMCOLOR><div class=smallfont> ±§Ç¸ - ûÓÐÕÒµ½. Çë³¢ÊÔһЩ²»Í¬µÄÓï¾ä£¡°´ä¯ÀÀÆ÷·µ»Ø¼ü»ò<a href=# class=\"link\" onclick=\"history.go( -1 );return true;\">µãÕâÀï·µ»Ø</a>¡£</div></td>");
print("</tr>");
print("<tr>");
print(" <td height=\"25\" bgcolor=$DARKCOLOR></td>");
print("</tr>");
print("</table>");
}
else {
print("<table width=\"100%\" bgcolor=\"#ffffff\" cellpadding=\"1\" cellspacing=\"1\">");
print("<tr>");
print(" <td colspan=2 height=\"25\" width=100% bgcolor=$DARKCOLOR align=center><div class=\"smallfont\"><font color=\"#ffffff\"><b>ËÑ Ë÷ ½á ¹û</b></font></div></td>");
print("</tr>");
print("<tr bgcolor=$MEDIUMCOLOR>");
print(" <td height=\"30\"><div class=smallfont> Äú²éÕҵĹؼü×ÖΪ: <font color=#ff0000>$name</font> ¹²ÕÒµ½ <font color=#ff0000>$num</font> ÌõÐÅÏ¢£¬ÒÔÏÂΪÏêϸÁÐ±í£º</div></td>");
print("<td align=right><div class=smallfont>¹² <font color=#ff0000>$pages</font> Ò³ µÚ <font color=#ff0000>$current_page</font> Ò³");
if ($offset) {
$preoffset=$offset-$page_num;
print(" <a href=search.php?action=search&offset=$preoffset&forumselect=$forumselect&kindselect=$kindselect&key=$name class=link>ÉÏÒ»Ò³</a> ");
}

if (($offset+$page_num)<$num) {
$nextoffset=$offset+$page_num;
print(" <a href=search.php?action=search&offset=$nextoffset&forumselect=$forumselect&kindselect=$kindselect&key=$name class=link>ÏÂÒ»Ò³</a> ");
}
print("</div></td></tr>");

//ÖðÌõ´òÓ¡ËÑË÷½á¹û
while ($row = @mysql_fetch_row($query_result)) {
while ($dbrow = mysql_fetch_object($res))
{print "ÏÔʾ¼Ç¼ ".($from+0)." - ";
print $to+$from-1;
print " (×ܹ² $total)\n<TR>";
for($i=0;$i<mysql_num_rows($res);$i++) {
$row=mysql_fetch_row($res);
$publisher=mysql_query("select fullname from publishers where id=$row[3];",$db);
$publisher=mysql_fetch_row($publisher);
$row[3]=$publisher[0];
print "<TD align=center><A href=\"details.php?isbn=$row[0]\">$row[1]</A></TD>";
for($j=2;$j<7;$j++) {
print "<TD align=center>$row[$j]</TD>";

print "<TD align=center><A href=\"order.php?isbn=$row[1]\"><IMG border=0 src=\"car.gif\"></A></TD></TR>\n";
}
print "<TR><TD colspan=7 align=center><A href=\"$PHP_SELF?from=0&total=$total\">Ê×Ò³</A> ";
if( $from>=2*$MAXROWS ) {
print "<A href=\"$PHP_SELF?from=".($from-$MAXROWS)."&total=$total\">ÉÏÒ»Ò³</A> ";
}
if( ($from+$to)<$total ) {
print "<A href=\"$PHP_SELF?from=".($from+$to)."&total=$total\">ÏÂÒ»Ò³</A> ";
}
if( ($total>$MAXROWS) ) {
print "<A href=\"$PHP_SELF?from=".($total-$total%$MAXROWS)."&total=$total\">ĩҳ</A>";
}
print "</TD></TR>\n";
}

?>

...全文
194 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
zxyufan 2002-02-07
  • 打赏
  • 举报
回复
两个括号一起写~~也写得顺手啊~~~看看键位的设计~~~括号为什么都在一起的呀~~前人多有远见啊~~pfpf~~~
little_f 2002-02-07
  • 打赏
  • 举报
回复
看得我好辛苦,能不能写得好看点?
danfeng 2002-02-06
  • 打赏
  • 举报
回复
括号匹配着这,这是一个写代码的人起码素质
3rd 2002-02-06
  • 打赏
  • 举报
回复
我一般写程序的时候,要是用到{,我就马上写个},然后再在两个中间写代码
wylyf 2002-02-06
  • 打赏
  • 举报
回复
乖乖,你写程序可真是够厉害的啊!
你写大括号的时候只记得写“{”,而忘了写“}”,大部分都是这个样子啊!
特别是你后面的那几个循环!我也很想帮你找一下,不过太费事了,你还是写的规范些慢慢找吧!
wylyf 2002-02-06
  • 打赏
  • 举报
回复
//if ($chanpin !='' ) $tempsql=$tempsql.'chanpin='.$chanpin;
//echo "1".$tempsql."<br>";
(1)在你这个注释前面少了一个"}"
zxyufan 2002-02-04
  • 打赏
  • 举报
回复
Parse error 是语法错误~~

除了少了}也有可能是抱错行的上一行没有加;号
taoy 2002-02-01
  • 打赏
  • 举报
回复
少了“}”
zh_yuandc 2002-02-01
  • 打赏
  • 举报
回复
凭我的经验,绝对是少了或多了“}”之类的小错误(经验教训哪),你不烦把代码写规范点,就可以看清是哪里的小小错了!
laosan 2002-02-01
  • 打赏
  • 举报
回复
我的二手显示器是12的,看的晕.对不住了.

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧