why my array get error because mysqli_fecth array? what I can do to the code to make is true because I'm a beginner of this. I change my code to mysqli_fetch_assoc()  but the error is the same.
this is the code that i make:
      <?php
      $query = mysqli_query($con,"SELECT t.po_nomor, p.nama_supplier, p1.nama_barang , t.total FROM 
        (SELECT t1.po_nomor, (SUM(t1.jumlah)-SUM(COALESCE(t4.terima,0))over(PARTITION by t4.refrence) ) as total 
        FROM pengiriman_supply t1 
        INNER JOIN data_supplier t2 ON t1.idsupplier = t2.id_supplier 
        INNER JOIN data_barang t3 ON t1.idbarang = t3.idbarang 
        LEFT JOIN masuk t4 ON t4.refrence = t1.po_nomor 
        where t1.tanggal BETWEEN date_sub(curdate(), interval 120 day) AND curdate() 
        group by t1.po_nomor,t4.po_nomor) t 
        INNER JOIN pengiriman_supply s ON s.po_nomor = t.po_nomor 
        INNER JOIN data_supplier p ON s.idsupplier = p.id_supplier 
        INNER JOIN data_barang p1 ON s.idbarang = p1.idbarang 
        GROUP BY t.po_nomor 
        ORDER by t.po_nomor DESC;");
      $no = 0;
      while($data = mysqli_fetch_array($query)){
       $no++;
       ?>
       <tr>
        <td><?= $no ?></td>
        <td><?= $data['po_nomor'] ?></td>
        <td><?= $data['nama_supplier'] ?></td>
        <td><?= $data['nama_barang'] ?></td>
        <td><?= $data['total'] ?></td>
      </tr>
      <?php
    }
    ?>   </tbody>
where I can change my code.
 
     
     
    