我遇到了一个奇怪的错误。
当我运行这个sql时:
select a.*, (((a.num_artigo NOT IN (select l.num_artigo from leiloes l))) | ((1 in (select n.RT from leiloes n where n.num_artigo = a.num_artigo)) << 1)) as TYPE from artigos_prazo a
在 phpmyadmin 中,它按预期返回一个表。
但是当我在 php 脚本中运行它时,它不会返回任何内容,而且我也没有收到来自数据库的错误。
<?php
$con = mysqli_connet...;
$sql = "select a.*, (((a.num_artigo NOT IN (select l.num_artigo from leiloes l))) | ((1 in (select n.RT from leiloes n where n.num_artigo = a.num_artigo)) << 1)) as TYPE from artigos_prazo a";
echo $sql;
echo mysqli_error($con);
$result = mysqli_query($con, $sql);
print_r($result);
while($row[] = mysqli_fetch_array($result));
print_r($row);
mysqli_close($con)
?>
它连接到数据库...
请帮忙
最佳答案
替换
while($row[] = mysqli_fetch_array($result));
print_r($row);
与
while($row = mysqli_fetch_array($result)) {
print_r($row);
}
关于php - Mysql 没有返回错误,但没有给出任何结果,但在 phpmyadmin 中它返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30842476/