下拉列表數據不顯示,我在數據庫中輸入PHP MySQL的傾斜讀取數據庫
Product Category:
<select name="product_cat">
<option>Select a Category</option>
<?php
$get_cats = "select * from categories";
$run_cats = mysqli_query($con, $get_cats);
while ($row_cats=mysqli_fetch_array($run_cats)){
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
echo "<option>$cat_title</option>";
}
?>
</select>
你現在越來越$ cat_title?如果是這樣,請將其改爲回顯「」; –