求解Call to a member function fetch_assoc() on a non-object
php吧
全部回复
仅看楼主
level 2
coc_fan 楼主
2014年07月07日 05点07分 1
level 2
coc_fan 楼主
$id=$_POST['um1-search-input'];
@ $db = new mysqli('localhost', 'root', 'abcde', 'classroom');
if (mysqli_connect_errno()) {
echo '连接错误,请重试!';
exit;
}
$query = "select bd_name from buildings where bd_name=".$id."";
$result = $db->query($query);
$row = $result->fetch_assoc();
$bd_name=$row['bd_name'];
2014年07月07日 05点07分 2
level 2
coc_fan 楼主
求大神帮一下忙啊、
2014年07月07日 07点07分 3
level 2
coc_fan 楼主
求大神帮一下忙啊、
2014年07月07日 11点07分 4
1