Welcome Guest, Not a member yet? Register   Sign In
Database Problem with returning information.
#1

[eluser]Jordz[/eluser]
G'day All,

I seem to be having trouble with returning information from my database.
In my controller I have:
Code:
function some(){
        echo "<pre>";
        $queue = $this->db->get_where('airports', array('icao'=>'ENGM'));
        $test = $queue->result();
        
        print_r( $test);
        
    }

This returns the information from the database:

Array
(
[0] => stdClass Object
(
[id] => 170
[icao] => ENGM
[iata] => OSL
[country] => Norway
[name] => Oslo Gardermoen
)

)

However, when I attempt to access the data in the array like this $test->name I get an error:
Quote:Severity: Notice


Message: Trying to get property of non-object


Filename: controllers/screening.php


Line Number: 49

I've tried everything and cannot access the array at all.
Any idea's?

Thanks

Jordan


Messages In This Thread
Database Problem with returning information. - by El Forum - 04-06-2010, 10:05 AM
Database Problem with returning information. - by El Forum - 04-06-2010, 10:12 AM
Database Problem with returning information. - by El Forum - 04-06-2010, 12:40 PM
Database Problem with returning information. - by El Forum - 04-06-2010, 12:57 PM
Database Problem with returning information. - by El Forum - 04-21-2010, 05:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB