$result->fetchAll(PDO::FETCH_ASSOC) ); echo json_encode($out); // close the database connection closeConnection($db); } catch (PDOException $e) { print 'Exception : ' . $e->getMessage(); } ?>