I am trying to connect to a database in MySQL server on MAMP (PHPMyAdmin). However, whenever I refresh my webpage, the error "This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500. Where did I go wrong?
$pdo = new PDO ('mysql:host=127.0.0.1;dbname=myPatient', 'root', 'root');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $pdo;