0
$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(主键)(只有一个)。

4

1 回答 1

1

添加mysqli_fetch_assoc()然后获取school_IDfrom 数组:

$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'];
于 2012-08-26T02:43:04.817 回答