什么是类型的资源(150)(mysql结果)?我在var_dumping选择查询之后得到了这个,
我的代码是:
$userlevelcheck = $this->query_silent("SELECT user_level FROM " . DB_PREFIX . "users WHERE user_id='" . $user_id . "'");
var_dump ($userlevelcheck);
if ($userlevelcheck != "1")
{
code
}
答案 0 :(得分:0)
尝试:
$userlevelquery = $this->query_silent("SELECT user_level FROM " . DB_PREFIX . "users WHERE user_id='" . $user_id . "'");
$row = mysql_fetch_assoc($query);
if ($row['user_level'] != "1")
{
code
}
您需要获取包含($ row)数据的行,然后检查相关字段$ row ['user_level']