findParent() function find array. There could be one array or more than one.
Now I want to make if statement depends on the number of array.
How can I make if statement using the number of array?
function findParent($order_id){
...
$Q = $this->db->get('omc_order_item');
if ($Q->num_rows() > 0){
foreach ($Q->result_array() as $row){
$data[] = $row;
}
}
...
return $data;
}
I tried this, but it does not work.
function deleteitem($order_id){
$childless = $this->MOrders->findParent($order_id);
if ($childless<2){
$data['childlessorder']= $this->MOrders->findParent($order_id);
...
It must be checking if $childless is less than 2.
How can I change it so that it will check the number of array is 1 (can be less than 2, doesn't it?)