java - Strict standards: Non-static method should not be called statically, assuming $this from incompatible context in php file -


i have rudimentary knowledge of php, , facing error retrieving json object php web service

strict standards: non-static method api_users::getrecordbyid() should not called statically, assuming $this incompatible context in .../lists.php on line 1387 

and because of error unable parse json object , error in android studio logcat

error parsing data org.json.jsonexception: value <br of type java.lang.string cannot converted jsonobject 

is there way can rid of error? php trying use:

  <?php     define('iem_path', '../admin/com');     require_once('../admin/includes/config.php');     require_once('../admin/com/lib/iem.class.php');     require_once ('../admin/com/lib/iem/dbfactory.class.php');     require_once ('../admin/com/lib/iem/baseapi.class.php');     require_once ('../admin/com/lib/api/users.class.php');     require_once ('../admin/com/lib/iem/baserecord.class.php');     require_once ('../admin/com/lib/record/users.class.php');          function getlists($userid = 0, $getunconfirmedcount = false) {              $userid = $_request['userid'];             if (!$userid) {                 trigger_error('this user object not loaded user.... need supply userid parameter.', e_user_notice);                 return false;             }               if (!$userid) {                 $userid = $this->userid;             }              require_once('../admin/functions/api/lists.php');              $listapi = new lists_api();             $returna =  $listapi->getlistbyuserid($userid, $getunconfirmedcount);             $returnresult1 = array();             foreach ($returna $key => $value) {                  //$lists[] = $key;                 $returnresult["contactlist"][] = array("listid" => $returna[$key]['listid'], "name" => $returna[$key]['name']);             }             $returnresult["success"] = 1;             echo json_encode($returnresult);         }          getlists(); 

and code believe source of error (line 1387)

$user = api_users::getrecordbyid($userid); 

this code copied class:

$userid = $this->userid; 

you don't have $this when you're not in (non static) member function.

just delete these 3 lines:

    if (!$userid) {         $userid = $this->userid;     } 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -