Welcome Guest, Not a member yet? Register   Sign In
db->get Error
#1

[eluser]Unknown[/eluser]
I have 2 functions that return an array.

Code:
/* Returns an array containing provinces */
function get_provinces($db){
    $query = $db->get('provinces');
    $provinces[0] = 'Not in US or Canada';    

    foreach($query->result_array() as $row) {
        $province_id = $row['province_id'];
        $province = $row['province'];    
        $provinces[$province_id]= $province;
    }
    return $provinces;
}

/* Returns an array containing countries */
function get_countries($db){
    $query = $db->get('countries');
    $countries[0] = 'choose one';
    foreach($query->result_array() as $row) {
        echo "$country_id <br>";
        $country_id = $row['country_id'];
        $country = $row['country'];    
        $countries[$country_id] = $country;
    }
    return $countries;
}

Whenever I call these functions back to back (as seen below), the script dies. If I comment out either of the below lines, the script runs normal, minus of course the variable that I comment out.
Code:
$data['provinces'] = get_provinces($this->db);            
    $data['countries'] = get_countries($this->db);

What am I missing here???


Messages In This Thread
db->get Error - by El Forum - 07-17-2008, 09:00 AM
db->get Error - by El Forum - 07-17-2008, 02:29 PM
db->get Error - by El Forum - 07-17-2008, 09:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB