Welcome Guest, Not a member yet? Register   Sign In
error in using ODBC

I am having trouble fetching the data using System DSN and ODBC. When i try issuing a query, it works but when fetching the rows, i got this error message

Fatal error: Call to a member function result() on a non-object in D:\webroot\sqws\cfapp\controllers\welcome.php on line 21

The script generating the error

$this->db->like('field', 'JOE');
        $query2 = $this->db->get('database.table');
        foreach ($query2->result() as $row)
           echo $row->field."<br />";

Here's my config

$db['default']['hostname'] = "System";
$db['default']['username'] = "scrpt";
$db['default']['password'] = "ex0du5";
$db['default']['database'] = "";
$db['default']['dbdriver'] = "odbc";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

I might be forgetting something..?

Got it to work.

you can only use $this->db->query('YOUR QUERY') in odbc connections.

Theme © iAndrew 2016 - Forum software by © MyBB