求鉴定异常,实在找不出来

WBOY
Release: 2016-06-13 10:16:41
Original
834 people have browsed it

求鉴定错误,实在找不出来





无标题文档






 

 

 
 

 

 


 

 

    $conn=mysql_connect("localhost","root","5200");
if(!$conn){
die ("连接失败".mysql_error());
}
mysql_select_db("blog",$conn) or die(mysql_error());

mysql_query("set names utf8");
$sql="select * from article";
$res=mysql_query($sql);
while($row=mysql_fetch_assoc($res)){


echo "
"; 41
echo "

$row['article_title']

";
echo "

$row['article_body']

";
echo "
";


}

   
 
 ?>
 






显示错误
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\wamp1\www\blog\index.php on line 41
明明我写的是;却还是这个错误。。求解释

------解决方案--------------------
echo "
"; 41
这错误没看出来? echo "
以下写法都算正确:
PHP code
// 转义双引号echo "<div class='\"article\"'>";// 改用单引号,防止与字符串内的双引号冲突echo '<div class="article">';// 方便一点的,改用echo html;<br><font color="#e78608">------解决方案--------------------</font><br>echo "<div class="article">"; //41<br>echo "<div class="article_title"><p>$row['article_title']</p></div>";<br>echo "<div class="article_body"><p>$row['article_body']</p></div>";<br>echo "</div>";<br><br>改为<br>echo <div class="article">
<br><div class="article_title"><p>$row[article_title]</p></div>
<br><div class="article_body"><p>$row[article_body]</p></div>
<br>
</div>
<br>HTML;<br><br>既简单又清晰<br>切记!最后的 HTML; 要顶格<br><div class="clear">
                 
              
              
        
            </div>
</div>
</div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template