I have two main classes, Database & Student now I want to execute a query in studentDetail()
method of Student Class. i.e.
But I am getting error that "Cannot redclare class Db in database_Class.php line:3"
studnet_Class.php
include "database_Class.php";
Class Student{
private $db,$studentName;
function __construct($DatabaseObj)
{
$this->db=$databaseObj;
}
public function studentDetail($ID)
{
$this->db->query("student",$ID);
}
}
index.php
$db= new Db();
$student= new Student($db);