我试图将我的查询结果存储到变量中但得到此错误
警告:mysql_fetch_assoc()期望参数1是资源,给定对象
$result = mysqli_query($con,"Select objectID from objects where objectName = '$_POST[relations]'");
if($result === FALSE) {
die(mysqli_error()); // TODO: better error handling
}
$result = mysql_fetch_assoc($result);
echo $result;
Run Code Online (Sandbox Code Playgroud)
存储此变量的任何其他方式?
| 归档时间: |
|
| 查看次数: |
4329 次 |
| 最近记录: |