When I\'m trying to insert data trough the database its says \"Uncaught Error: Call to private method DbOperations::insertData() from context \'\'\".
My insert data PHP
You cannot call private methods or fields outside class
Either make the function insertData() public by defining it as follows
public function insertData() {
************
}
or call it from constructor using
function __construct($airport, $location, $space , $flight){
$db = new DbConnect();
$this->con = $db->connect();
$this->insertData($airport, $location, $space , $flight);
}
run it as follows:
$db = new DbOperations($_POST['airport'], $_POST['location'], $_POST['space'], $_POST['flight']);