Note that there are some explanatory texts on larger screens.

plurals
  1. POto get property of other objects into the class methods, into my Gazzet calss
    text
    copied!<p>in my Gazzet class i m facing error , i cant understand please explain it, </p> <p>Notice: Trying to get property of non-object in E:\Web\xampp\htdocs\oop\includes\gazett.php on line 71 Notice: Trying to get property of non-object in E:\Web\xampp\htdocs\oop\includes\gazett.php on line 72 Notice: Undefined variable: courseName in E:\Web\xampp\htdocs\oop\includes\gazett.php on line 174 Fatal error: Cannot access empty property in E:\Web\xampp\htdocs\oop\includes\gazett.php on line 174</p> <pre><code>class Gazzet{ private $course, $Regid ; public $InstName, $Address; public $courseName, $E_Year; public $InstName, $Address; public $courseName, $E_Year; function __construct($Course, $Regid){ $this-&gt;course=$Course; $this-&gt;Regid=$Regid; $this-&gt;madersaName(); $this-&gt;course_name(); } private function madersaName(){ global $obj_madrsa_name; $obj_madrsa_name = Madaris::madaris_by_id($this-&gt;Regid);//here i want to try get public property of obj_madrsa_name , but in vein i m error facing $this-&gt;InstName=$obj_madrsa_name-&gt;InstName;// same above error, line 71 $this-&gt;Address=$obj_madrsa_name-&gt;Address; //same above error, line 72 </code></pre> <p>}</p> <pre><code> private function course_name(){ global $obj_course; $obj_course = Courses::courseName($this-&gt;course); $this-&gt;$courseName = $obj_course-&gt;courseName; // same here, above given error face, line 174 $this-&gt;$E_Year = $obj_course-&gt;E_Year; // same here, above given error face, line 174 } </code></pre> <p>}</p> <p>$gazett = new Gazett($Course);</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload