Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "indicadls02";
- $database = "segmentor";
- $conn = new mysqli($servername, $username, $password, $database);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully <br>";
- error_reporting(-1);
- class gang {
- private $operators;
- public function fetchOperators() {
- $class = get_class($this);
- echo "$class <br>";
- $class = "PushCrew";
- $que = "select * from Operators where Tag = '$class' ";
- echo "$que <br>";
- if(mysqli_num_rows(mysqli_queri($conn, $que)) > 0) {
- echo "query is true <br>";
- $operators = $conn->query($que);
- print_r($operators);
- }
- else {
- echo "select query failed <br>";
- }
- }
- public function getOperators() {
- $this->operators = $this->fetchOperators();
- if(get_parent_class($this)) {
- echo "parent exists <br>";
- echo "$this->operators OPS <br>";
- $parent = get_parent_class($this);
- $temp = new $parent();
- $operatorsInherited = $temp->getOperators();
- echo "$operatorsInherited inherited<br>";
- $this->operators += ($operatorsInherited);
- }
- else {
- echo "tree finished <br>";
- }
- return $this->operators;
- }
- }
- class bang extends gang{
- private $operators;
- };
- $ob2 = new bang();
- $ob2->fetchOperators();
- //$arr = $ob2->getOperators();
- //print_r($arr);
Add Comment
Please, Sign In to add comment