this is what I'm trying to achieve with me two delivery and payment tables


so I want to display data that is not in the payment table, but exist in the delivery table, since you can see that the payment table has [del_id] 2 and 3. therefore I try to get [delivery_id] 1. but some of them also retrieving [delivery_id] 2.
here is the model code
public function noPayment_tables(){
$query = $this->db->query('SELECT del_id FROM payments');
foreach ($query->result_array() as $row)
{
echo $row['del_id'];
}
$this->db->select('*');
$this->db->from('delivery');
$this->db->where_not_in('delivery_id', $row);
return $this->db->get()->result();
}
and controller
public function status(){
$data['mixs'] = $this->time_model->noPayment_tables();
$data['main_view'] = "status_view";
$this->load->view('header', $data);
}
and browse
<table class="table">
<thead>
<tr>
<th>consignee</th>
<th>airway id</th>
<th>status</th>
</tr>
</thead>
<tbody>
<?php foreach ($mixs as $ta): ?>
<tr>
<td><?php echo $ta->consignee ?></td>
<td><?php echo $ta->airway_id ?></td>
<td><?php echo $ta->delivery_id ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
and current result

source
share