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. error 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
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
$ this-> user_login_model , which is wrong Try instead: < / P>
$ this-> CIA E-> User _ Login-Model-> Adactivity ('Login', $ activity_data);
Comments
Post a Comment