Welcome Guest, Not a member yet? Register   Sign In
passing array from controller to model
#1

[eluser]bill19[/eluser]
Hi everyone,

I'm a CI noob. I am trying to pass an array of variables to a model from a controller, but I'm having problems:

my controller has the following:

Code:
$sAP['st']=$st;
$sAP['monthsAgo']=$monthsago;
$sAP['aP']=$aP;

$success=  $this->load->model('zipCodeData', $sAP);

my model has the following:

Code:
function __construct($sAP)
    {
        parent::__construct();
    }


    function insert() {
        
                        

                        echo $st;
        
        
       // $this->db->insert();
        
    }

my understanding is that CI is supposed to uses php5's extract function to turn the passed data array elements into variables.

Obviously this is not happening.

Thanks in advance,

KC




Theme © iAndrew 2016 - Forum software by © MyBB