function supervisor_from_email($email, $p_id) {
$email = sanitize($email);
return mysql_query("SELECT pm.supervisor FROM project_members AS pm JOIN users AS u ON pm.project_member_id = u.user_id WHERE u.email = $email AND pm.project_id = $p_id");
}
是我调用的函数,$email 和 $p_id 是正确的,我已经在数据库上运行了查询,它返回了正确的值(1 或 0)
我希望能够在页面上回显它,然后根据它决定是否检查复选框,但是当我在运行函数后尝试回显时,如下所示:
$supervisor = supervisor_from_email($email, $p_id);
echo $supervisor;
这没用?有任何想法吗?