问题是配置文件中是mysql所以我把它改成mysqli
但现在我在 html 区域的选择中看不到结果
这是php脚本
<?php require 'config.php'; $query = "SELECT cat_id, category FROM categories LIMIT 1"; $result = mysqli_query($con,$query); if(!$result){ echo 'Query failed : '.mysqli_error(); exit(0); } $row = mysqli_fetch_assoc($result); // mysql_fetch_assoc was the problem print_r($row); mysql_close($con); ?>
这是html脚本
<select name="cat_id"> </select>
这是错误
Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home/content/60/10533160/html/cms/in.php on line 5 Warning: mysqli_error() expects exactly 1 parameter, 0 given in /home/content/60/10533160/html/cms/in.php on line 7 Query failed :