Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何获取以前查找的行的MySQL主键?_Php_Mysql_Html_Css_Database - Fatal编程技术网

Php 如何获取以前查找的行的MySQL主键?

Php 如何获取以前查找的行的MySQL主键?,php,mysql,html,css,database,Php,Mysql,Html,Css,Database,$school\u ID\u result变量需要包含它刚刚查找的行的school\u ID(主键)(将只有一个)。添加,然后从数组中获取school\u ID: $query_check_domain_exists = "SELECT * FROM schools where domain ='$email_domain'"; $result_check_domain_exists = mysqli_query($d_schools, $query_check_domain_exists);

$school\u ID\u result变量需要包含它刚刚查找的行的school\u ID(主键)(将只有一个)。

添加,然后从数组中获取
school\u ID

$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 = ?

能否显示示例表数据和希望检索的示例?“SELECT*”返回包含主键字段的完整行。
$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'];