I'm confused finding the difference between bind_param()
and bindParam()
as both are supported in PHP5 but one takes type as the first parameter and other takes a placeholder. Can someone give me an example of when to use one or the other?
Asked
Active
Viewed 3,228 times
5

doelleri
- 19,232
- 5
- 61
- 65

user2904995
- 93
- 1
- 5
-
6which class contains `bind_param`? Current PDO doesn't look like it contains a `bind_param` method http://php.net/manual/en/book.pdo.php – dm03514 Oct 21 '13 at 23:12
2 Answers
14
bind_param is a method on mysqli_stmt:
bindParam is a method on PDOStatement:
The difference?
- mysqli is a replacement for the deprecated mysql functions
- PDO (PHP Data Objects) is a general database abstraction layer with support for MySQL, but also many other databases (sqlite, postgresql, oracle,...).
For more info look at this: