<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$conn=mysql_connect("localhost","root","123456");if(!$conn){ die('could not connect:'.mysql_error());}else{ echo '链接正常<br>';}mysql_select_db("zuitu_db",$conn);$sql="select * from category order by id desc"; // $sql="select * from 'category'";这样写有错吗?$res=mysql_query($sql);$i=1;$strTemp='';/* 下面这个while循环,为何读不出数据?*/while($row=mysql_fetch_array($res)){ if($i==1) { $strTemp=$row["name"]; } else { $strTemp+='<br>'.$row["name"]; } // ($i==1)?$strTemp=$row["name"]:strTemp+='<br>'.$row["name"]; 这样写有误吗? $i+=1;}echo $strTemp;//以上内容 请大家帮忙指正,多谢!
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