php - error call to member function -


When I login, I am trying to set up some user activity for the codeigner project so I can see Which user logs on and off

I have data below at my library function login but now throws an error about fixing this Not sure in. $ this-> CI- & gt; session-> User Data ('user_id'), 'name' = & Gt; $ -> -> CI- & gt; Session- & gt; User Data ('First Name'). $ $-> CI- & gt; Session- & gt; User Data (' last name')); $ This- & gt; CI- & gt; Load-> Model ('Admin / General / user_login_model'); // here error 27 $ this- & gt; User_login_model- & gt; Adactivity ('Login', $ activity_data);

error

  encountered a PHP error Severity: Information Message: Undefined property: User: $ user_login_model File Name: Library / User.php Line number: 27 Fatal error: C: \ Xampp \ htdocs \ codeigniter-cms \ application \ libraries \ User.php Call addActivity () on a non-member member function on line 27   

on model User- & gt; GetID (); If (isset ($ data ['user_id'])) {$ user_id = $ data ['user_id']; } And {$ user_id = 0; } $ The-> gtc-> key = ". $$ - gt; escape ($ key).", `Data` =". $ This-> db-> escape (serialize ($ data) ) ",` `IP =>. $ This-> db- & gt; Escape ($ this-> Input-> Server ('REMOTE_ADDR')).", `Date_added` = NOW () ");

}

It seems that you have ci Made an example and loaded the model in it. Nevertheless, you try to enter directly from model class with $ this-> user_login_model , which is wrong Try instead: < / P>

  $ this-> CIA E-> User _ Login-Model-> Adactivity ('Login', $ activity_data);    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -