if(empty($page)||$page< 0) { $page=0; } $p1=$page*20; $limit="limit $p1,20"; $sql1="SELECT * FROM news WHERE type = $type order by id DESC".$limit; $result=mysql_query($sql1,$connect);
if(empty($page)) $page=0; $pages=$page*20; $limit="limit $pages,20"; $sql="SELECT * FROM news where type=$type order by id DESC ".$limit; $result=mysql_query($sql,$connect);
这两段难道有什么不同吗?怎么第一个在提取while($array = mysql_fetch_array($result))时老报错??
真搞不懂!
还有个问题:$sql="SELECT * FROM biyesheng2005 where xuehao ='$ic'order by xuehao DESC "; 假设变量$time=2005 为什么语句写为$sql="SELECT * FROM biyesheng"&$time&"where xuehao ='$ic'order by xuehao DESC ";时 提示出错?