gpt4 book ai didi

php - mysqli 获取数组返回 null 作为结果

转载 作者:行者123 更新时间:2023-11-30 00:36:59 25 4
gpt4 key购买 nike

不知道我的结果什么也没返回

    if ($stmt2->execute()) {
$photo_items = $stmt2->get_result();

while ($imgArray = $photo_items->fetch_array()) {
}
echo $imgArray[] = $imgArray;
}

我也尝试过这个

            echo  $imgArray[] = $imgArray['mycolname'];

最佳答案

尝试

while ($img = $photo_items->fetch_array()) {
$imgArray[] = $img;
}

要查看数组元素,请尝试:

print_r($imgArray);

关于php - mysqli 获取数组返回 null 作为结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22088458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com