query($query); $prepare->execute($array); $data = $prepare->fetchColumn(); return $data; } elseif($method == 'insert') { $prepare = $sql->prepare($query); $prepare->execute($array); } elseif($method == 'fetch') { $prepare = $sql->query($query); $prepare->execute($array); return $prepare->fetch(); } else { $prepare = $sql->prepare($query); $prepare->execute($array); return $prepare->fetchAll(); } } catch(Exception $e) { throw($e); } } ?>