Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @return PDOStatement|false
- */
- public function run($sql, $args = [])
- {
- if (!$args) {
- return $this->pdo->query($sql);
- }
- if ($stmt = $this->pdo->prepare($sql)) {
- if ($stmt->execute($args)) {
- return $stmt;
- }
- }
- return false; //either prepare or execute failed
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement