Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. /**
  2. * @return PDOStatement|false
  3. */
  4. public function run($sql, $args = [])
  5. {
  6. if (!$args) {
  7. return $this->pdo->query($sql);
  8. }
  9. if ($stmt = $this->pdo->prepare($sql)) {
  10. if ($stmt->execute($args)) {
  11. return $stmt;
  12. }
  13. }
  14.  
  15. return false; //either prepare or execute failed
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement