PHP PHP & Databases with PDO PDO Database Security PHP & Databases with PDO

ac gev
ac gev
Front End Web Development Techdegree Student 11,945 Points

It looks like there is no Exception class

I passed Exception class to an object named $e. So I don't know why this message appear: It looks like there is no Exception class

index.php
<?php

//Place your code below this comment
try{
  $db = new PDO('sqlite::memory');
  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $e){
  echo $e->getMessage();
}
?>

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,589 Points

Not a very useful error message. Your code is good but the reason it fails the challenge is including the echo statement. Delete that and you'll pass.