Why I am I getting this error – Message: Use of undefined constant orders – assumed ‘orders’ (this will throw an Error in a future version of PHP)

This is model function

function getOrderList($postVal = array()){

if(isset($postVal['query_type']) && $postVal['query_type']=="count"){

$result = 0;

}else{

$result = array();

}

$fields = "o.*,s.name as status";

$this->zcart_db->select($fields);

$this->zcart_db->from(orders.' o');

$this->zcart_db->join(order_statuses.' s','s.id=o.order_status_id','left');

$this->zcart_db->order_by('o.order_status_id','desc');

/*Pagination Start*/

if(isset($postVal['query_type']) && $postVal['query_type']=="pagination"){

$pgArr = calculatePageNumber($postVal['page']);

$this->zcart_db->limit($pgArr['n2'],$pgArr['n1']);

}else if(isset($postVal['limited']) && ($postVal['limited'] > 0)){

$this->zcart_db->limit($postVal['limited']);

}

/*Pagination End*/

$query = $this->zcart_db->get();

if($query->num_rows() > 0){

if(isset($postVal['query_type']) && $postVal['query_type']=="count"){

$result = $query->num_rows();

}else{

$result = $query->result_array();

}

}

return $result;

}
Asked on February 4, 2020 in Mysql.

Hey,I got this issue fixed by declaring required constants in table-config file in config folder 🙂

on February 5, 2020.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.