Welcome Guest, Not a member yet? Register   Sign In
[Solved] Call to a member function result_array() on a non-object
#1

[eluser]Arasoi[/eluser]
[UPDATE]

Ok folks , Found the issue. Seems in the table i was trying to view a field had its data type set to nvarchar. PHP MSSQL in general hates this datatype. Switching it to just varchar fixes the issues. Just as a heads up for future ref nvarchar bad, varchar good.

Big Grin


-----------------------------------------------------------------------------------------

OK I have found just about every post on here about this error or a version of it and have yet to find an answer. So up goes the post SmileAny Help/insights would be very welcome.
I have not posted the view as it is a tad large but if you need it let me know.

Here is what i have going on.
If I change the table used from fc_AddressRequests -> fc_AddressRequests_View it works fine. The table does exist and if i take the SQL created by CI and run it against the Db out side of CI it returns a result fine. I have this problem with many of the query methods such as num_rows().

[Error Received]
Code:
Fatal error: Call to a member function result_array() on a non-object in C:\Inetpub\Vesta\Dev\system\application\models\FieldCheck\findicoms_model.php on line 72

[Model]

Code:
68    function con_getfieldcheck($ID){
69        $this->load->database('default', TRUE);
70        $this->db->where('ID',$ID);
71        $query =  $this->db->get('fc_AddressRequests');
72        return $query->result_array();
73
74    }

[Controller]

Code:
54    function viewID($FCID)
55    {
56        $EID = substr($_SERVER["AUTH_USER"], -7);
57        
58        $this->output->enable_profiler(TRUE);
59        $data = array(
60        'Results'    => $this->findicoms_model->con_getfieldcheck($FCID),
61        'StatusValues'    => $this->findicoms_model->con_getStatus()
62        );
63        $this->load->view('FieldCheck/FC_view.php',$data);
64    }




Theme © iAndrew 2016 - Forum software by © MyBB