Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public function bind($param, $value, $type = null)
  2. {
  3. if (is_null($type)) {
  4. switch (true) {
  5. case is_int($value):
  6. $type = PDO::PARAM_INT;
  7. break;
  8. case is_bool($value):
  9. $type = PDO::PARAM_BOOL;
  10. break;
  11. case is_null($value):
  12. $type = PDO::PARAM_NULL;
  13. break;
  14. default:
  15. $type = PDO::PARAM_STR;
  16. }
  17. }
  18. $this->stmt->bindValue($param, $value, $type);
  19. }
  20.  
  21. `$this->bind(":id","1","is_int");`
  22.  
  23. //output = $this->stmt->bindValue(:id,1,is_int);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement