gpt4 book ai didi

php - MySQL 直接给出结果,虽然没有通过脚本

转载 作者:行者123 更新时间:2023-11-29 05:27:23 24 4
gpt4 key购买 nike

我正在编写脚本,它在这段代码部分从 MySQL 服务器检索信息但是:

这是正在执行的命令:

通过这段代码执行命令,没有给出结果:

$zapytanie = "SELECT * FROM all_orders WHERE (ID = '2' OR ID = '3' OR ID = '5' OR ID = '7' OR ID = '9' OR ID = '10' OR ID = '11' OR ID = '15' OR ID = '17' OR ID = '18' OR ID = '19' OR ID = '22' OR ID = '24' OR ID = '25' OR ID = '26' OR ID = '27' OR ID = '28' OR ID = '29' OR ID = '30' OR ID = '31' OR ID = '32' OR ID = '35' OR ID = '36' OR ID = '37' OR ID = '38' OR ID = '39' OR ID = '40' OR ID = '41' OR ID = '45' OR ID = '47' OR ID = '48' OR ID = '49' OR ID = '50' OR ID = '53' OR ID = '54' OR ID = '55' OR ID = '56' OR ID = '57' OR ID = '60' OR ID = '61' OR ID = '62' OR ID = '63' OR ID = '64' OR ID = '65' OR ID = '67' OR ID = '68' OR ID = '69' OR ID = '70' OR ID = '71' OR ID = '72' OR ID = '73' OR ID = '74' OR ID = '75' OR ID = '76' OR ID = '81' OR ID = '82') AND status='sent' ORDER BY ID ASC";

$validate = mysqli_query($con,$zapytanie);
while($row = mysqli_fetch_array($validate)) {
$array[$i] = $row[ID];
$i++;
}
print_r($array, true);

直接执行的结果出现 - 1 行:

http://fotteria.pl/uploads/gallery/0/0/ec46b7/319df40409.jpg

我真的不知道那里发生了什么,但如您所见,我可以通过此命令直接检索结果,但是在这段代码上使用时没有结果出现。

最佳答案

print_r($array, true);

是你的问题

$zapytanie = "SELECT IN FROM all_orders WHERE ID IN(2,3,5...) AND status='sent' 
ORDER BY ID ASC";
$array = array();
$result = mysqli_query($con,$zapytanie);
while($row = mysqli_fetch_array($result)) {
$array[] = $row['ID'];
}
print_r($array);

关于php - MySQL 直接给出结果,虽然没有通过脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18574798/

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