Welcome Guest, Not a member yet? Register   Sign In
Can't acccess personnal library
#5

(This post was last modified: 07-23-2016, 01:39 AM by Wouter60.)

Usually, collecting data from your database is done by a Model, not a Library.
In a model, you can use the $this->db object without instantiating the super-object.

One more tip about your method. You are looping through a result_array(), but it seems that you expect the result to be 1 record.
In that case you can return this record like this:

PHP Code:
$query $this->CI->db->get_where('cms', array('page_name' => $pageName), 1);
return 
$query->row_array(); 
Reply


Messages In This Thread
Can't acccess personnal library - by Theo - 07-22-2016, 05:06 AM
RE: Can't acccess personnal library - by Avenirer - 07-22-2016, 06:07 AM
RE: Can't acccess personnal library - by Theo - 07-22-2016, 06:22 AM
RE: Can't acccess personnal library - by Wouter60 - 07-23-2016, 01:39 AM
RE: Can't acccess personnal library - by Theo - 07-23-2016, 04:08 AM
RE: Can't acccess personnal library - by PaulD - 07-23-2016, 04:33 AM
RE: Can't acccess personnal library - by Theo - 07-24-2016, 03:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB