判断取出的结果集是否为空集: $sql="select adminPwd from adminaccount"; //判断查询是否有数据 if(mysqli_num_rows($result)>0){}