Welcome Guest, Not a member yet? Register   Sign In
Acquisition of user_profile for dx_auth
#1

[eluser]Unknown[/eluser]
I would like to display user_profile by /myspace.


class Myspace extends Controller {

function myspace()
{
parent::Controller();
$this->load->database();
$this->load->model('dx_auth/user_profile', 'user_profile');
$this->load->library('DX_Auth');
}

function index()
{
if ( !$this->dx_auth->is_logged_in())
{
redirect('/auth/login');
}

else
{
$data['username'] = $this->dx_auth->get_username();
$data['userprofile'] = $this->user_profile->get_profile($this->dx_auth->get_user_id()Wink;
var_dump($data['userprofile']);

}
}
}

However, $data['userprofile'] is bool(false).
I have faced Error Number:1064.It is a content of generating a wrong SQL sentence.look at the under.

SELECT * WHERE `user_id` = '5'

I confirmed models\dx_auth\user_profile.
And, it was noticed that $this->_table of the ninth line was empty.

What is wrong?
#2

[eluser]Unknown[/eluser]
The following were added.

$this->config->load('dx_auth');

Then, it became it according to hope.
Thanks.
#3

[eluser]JulianM[/eluser]
Thanks ideapon, your hint solved my problem.
I added that line of code *before* loading the library and model.

Julian




Theme © iAndrew 2016 - Forum software by © MyBB