$db=new DataBase();
It is a object I created globaly. For accessing this in a function , I used global keyword. Here is the code:
include "Database.php";
$db=new DataBase();
function getUser()
{
$uname=$_SESSION['UNAME'];
global $db,$uid;
$result2=$db->selectUserDetails();
$result3=$db->selectUserPermission($uid);
$table = constructTable($result2, $result3);
echo $table;
}
and when i am using that, it is showing an error
"Fatal error: Call to a member function selectUserDetails() on a non-object
in C:\\wamp\\www\\listdetails.php on line 27"
Anyone can tell me a solution.