Welcome Guest, Not a member yet? Register   Sign In
access variables from other function within same class?
#1

[eluser]Kristof[/eluser]
Code:
class M_airports extends model {    
    function addAirport() {
         $data = array(
            'airportname' => $this->input->post('airportname'),
            'airportwebsite' => $this->input->post('airportwebsite'),
            'airportphone' => $this->input->post('airportphone'),            
        );
        $this->db->insert('aiports', $data);
        $ID = $this->db->insert_id();    
    }
    function addAirportpics($filename,$filelocation) {      
        $data = array(
            'AirportpicsAirportid' => $ID,
            'AirportpicsFolder' => $filelocation,
            'AirportpicsFilename' => $filename
        );
        $this->db->insert('airportpics', $data);    
    }
}

I need the $ID in the addAirportpics function but i don't know how to get to it. Could someone please help me out with this? Thanks in advance


Messages In This Thread
access variables from other function within same class? - by El Forum - 09-28-2009, 04:08 AM
access variables from other function within same class? - by El Forum - 09-28-2009, 04:20 AM
access variables from other function within same class? - by El Forum - 09-28-2009, 04:57 AM
access variables from other function within same class? - by El Forum - 09-28-2009, 05:59 AM
access variables from other function within same class? - by El Forum - 06-04-2011, 02:37 AM
access variables from other function within same class? - by El Forum - 06-04-2011, 02:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB