Please consider my "execute" method of my db class. When I pass it a bad sql, it does not thow the PDOException, just returns $return === false and does not do anything in the db. What am I missing?
public function execute($sql){
if (!$this->connection){
try{
$conn = new pdo(self::$dbName
,self::$user
,self::$password);
}
catch (PDOException $e) {
$c = "Error in connecting <br/>";
$c .= $e->getmessage() . "<br/>";
p0110error::terminal($c);
}
$this->connection = $conn;
}
try{
$return = $this->connection -> exec($sql);
}
catch (PDOException $e){
$c = "Error in sql <br/>";
$c .= $sql . "<br/>";
$c .= $e->getmessage() . "<br/>";
p0110error::terminal($c);
}
if ($return === false) {
$c = "Error in sql <br/>";
$c .= $sql . "<br/>";
$c .= "... returned false <br/>";
p0110error::terminal($c);
}
return $return;
}