Welcome Guest, Not a member yet? Register   Sign In
MySQL, Querybuilder, Controller problems... ERR 2014
#5

Try this and see if the error goes away.

PHP Code:
class Suppliers_model extends CI_Model {

    public function 
__construct()
    {
        
$this->load->database();
    }

    public function 
get_suppliers($id FALSE)
    {
        
$data = array();

        if (
$id === FALSE)
        {
            
//$query = $this->db->get('suppliers');
            
$query $this->db->query('call read_supplier_list()');
            
$data  $query->result_array();

            
$query->free_result();
            return 
$data;
        }

        
$query $this->db->query('call read_supplier(' $id ')');
        
//$query = $this->db->get_where('suppliers', array('id' => $id));

        
$data $query->row_array();
                
        
$query->free_result();
        return 
$data;
    }

    public function 
get_supplier_certificates($supplier_id)
    {
        
$data = array();
            
        
//$query = $this->db->query('call read_supplier_certificates(' . $supplier_id . ')');
        
$query $this->db->get_where('supplier_certificates', array('supplier_id'$supplier_id));
        
$data  $query->result_array();
                
        
$query->free_result();
        return 
$data;
    } 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: MySQL, Querybuilder, Controller problems... ERR 2014 - by InsiteFX - 03-19-2017, 05:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB