$query_check_domain_exists = "SELECT * FROM schools where domain ='$email_domain'";
$result_check_domain_exists = mysqli_query($d_schools, $query_check_domain_exists);
$school_ID_result = ?
$ school_ID_result变量需要包含刚刚查找的行的school_ID(主键)(只有一行)。
答案 0 :(得分:1)
添加mysqli_fetch_assoc(),然后从数组中获取school_ID
:
$query_check_domain_exists = "SELECT * FROM schools where domain ='$email_domain'";
$result_check_domain_exists = mysqli_query($d_schools, $query_check_domain_exists);
$row = mysqli_fetch_assoc($result);
$school_ID_result = $row['school_ID'];