-
-
Save datibbaw/57081bf47e2fc2d33f62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (preg_match('_^\s*SELECT _i', $query)) { | |
return $stmt->$fetch(PDO::FETCH_ASSOC); | |
} elseif (preg_match('_^\s*INSERT _i', $query) { | |
return $this->lastInsertId(); | |
} elseif (preg_match('_^\s*UPDATE _i', $query) || preg_match('_^\s*DELETE _i', $query) { | |
return $stmt->rowCount(); | |
} | |
return $stmt->$fetch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment