A simple PHP model-view-controller framework, built step-by-step as part of the "Write PHP like a pro: build an MVC framework from scratch" course on Udemy.
Fatal error: Uncaught Error: Call to a member function prepare() on null in C:\xampp\htdocs\joblister\lib\Database.php:32 Stack trace: #0 C:\xampp\htdocs\joblister\lib\job.php(10): Database->query('SELECT jobs.*, ...') #1 C:\xampp\htdocs\joblister\index.php(15): Job->getAllJobs() #2 {main} thrown in C:\xampp\htdocs\joblister\lib\Database.php on line 32 #114
The error message is saying $this->dbh is null - this happens when it hasn't connected for some reason, probably because of incorrect database credentials (user, password)
<?php class Database { private $host = DB_HOST; private $user = DB_USER; private $pass = DB_PASS; private $dbname = DB_NAME;
}