this will be probably stupid problem, but i can't solve it, so i hoped, you can help me guys.
I have PDO connection (bdd.php)
$db = new PDO(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET utf8"
Fatal error: Call to a member function prepare() on a non-object on Index.php on row 6
$sql = "SELECT id, title, start, end, color FROM events ";
$req = $bdd->prepare($sql);
$events = $req->fetchAll();
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
It looks like
$req = $bdd->prepare($sql); is where your problem is coming from.
bdd.php you are assigning the database connection to
Simply change either of them so that they are the same.
$bdd = new PDO(
$req = $db->prepare($sql);