hi have a code structure like this
public static $userId;
public static $checkUserId;
public $chckUserId;
function __CONSTRUCT(){//Constructor
parent::__CONSTRUCT();
self::$userId = $_SESSION["userid"];//Asssign Current Logged In User's UserId
}
this works holding user session then i want to hold one changing session coz i ant to use it in all function of the class i want to be assigned in a public variable , i assigned and worked but not changing what could be the problem?
can u please suggest hw can i implement that?
You would need to set the value by reference if you are to hold the changing value.
However, it will be a bad design to do so. Every time you construct an Object, you should so any required assignments inside the constructor.
Edit: Code Added