0

I'm having a strange error.

when i run this 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

in phpmyadmin it return a table as it was supposed to be.

but when i run it in a php script it does not return nothing, also I receive no error from the database.

    <?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)
    ?>

It connects to the database...

Help please

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43

1 Answers1

0

Replace

while($row[] = mysqli_fetch_array($result));
print_r($row);

with

while($row = mysqli_fetch_array($result)) {
    print_r($row);
}
Alexander
  • 19,906
  • 19
  • 75
  • 162