由于某种原因,除非我忽略了一些东西,这段代码在这里:
<?
include_once("connect.php");
$sql = "SELECT * FROM categories ORDER BY category_title ASC";
$res = mysqli_query($con,$sql) or die(mysql_error());
$categories ="";
if (mysqli_num_rows($res) > 0) {
while($row = mysqli_fetch_assoc($res)){
$id = $row['id'];
$title = $row['category_title'];
$description = $row['category_decription'];
$categories .= "<a href='#' class='cat_links'>".$title." - <font size='-1'>".$description."</font></a>";
}
echo $categories;
} else {
echo"<p>There are no categories available yet.</p>";
}
?>
似乎将此反映在页面上:
0){while($ row = mysqli_fetch_assoc($ res)){$ id = $ row [&#39; id&#39;]; $ title = $ row [&#39; category_title&#39;]; $ description = $ row [&#39; category_decription&#39;]; $ categories。=&#34;&#34;。$ title。&#34; - &#34;。$ description。&#34;&#34 ;; } echo $ categories; } else {echo&#34; 目前还没有类别。
&#34 ;; }?&gt;
我做错了什么?
提前致谢!