[Solved] Error : $data not defined in function users  

  RSS

abahaudd
(@abahaudd)
Active Member
Joined: 7 months ago
Posts: 8
31/03/2019 8:32 pm  

This function also gives the $data not defined error when $id is blank.

public static function users($sessionId,$id){

if($id != ''){
$data='userId='.$id;
}

return self::curl('/api/users?'.$data,'GET',$sessionId,'',array());
}

I am getting around it by doing this - 

public static function users($sessionId, $data=''){

       return self::curl('/api/users?'.$data,'GET',$sessionId,'',array());

}


Quote
abahaudd
(@abahaudd)
Active Member
Joined: 7 months ago
Posts: 8
31/03/2019 8:42 pm  

Pl delete the above post.  That did not fix the issue


ReplyQuote
jaimzj
(@jaimzj)
Guru Admin
Joined: 1 year ago
Posts: 58
31/03/2019 10:19 pm  

I re-checked the code now, even with $id set to blank or no data it still works and returns the expected result.

You probably have your php error display turned on. the $data is not defined does not stop the code from working or you from achieving results.

 

Markers & maps are magical !!!


ReplyQuote
abahaudd
(@abahaudd)
Active Member
Joined: 7 months ago
Posts: 8
01/04/2019 7:34 pm  

Ok. Thanks


ReplyQuote
Share:
  
Working

Please Login or Register