$pKeyArray 只打印数据库中满足 WHERE 子句的第一行,为什么不显示所有满足 WHERE 子句的行,我不想把它放在任何循环中,我只需要一个数组所有行的 P_Key。
$getPKey = "SELECT P_Key FROM likersTable WHERE executed=0";
$PKeyDetails = mysqli_query($dbConnect,$getPKey)
or die('Some error in post id');
$pKeyArray = mysqli_fetch_array($PKeyDetails);
print_r($pKeyArray);
最佳答案
您需要为每一行调用 mysqli_fetch_array()
。
while ($pKeyArray = mysqli_fetch_array($PKeyDetails)) {
print_r($pKeyArray);
}
关于php - 选择查询仅获取第一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10503768/