Execute a query

function executeQuery($query) { $conn = $this -> getConnection(); $stmt = $conn -> prepare($query); $result = $stmt -> execute(); if ($result == true) { $result_set = $stmt -> fetchAll(PDO::FETCH_ASSOC); } else { $result_set = null; } return $result_set; }