bindparam
BindParam is a method of PHP's PDOStatement class used to bind a parameter in a prepared SQL statement to a PHP variable by reference. The binding persists until the statement is executed, allowing the actual value to be supplied at execution time rather than when the binding is defined.
Parameters can be named placeholders (for example :name) or question marks ?. The first argument identifies the
Binding by reference means that the value assigned to the variable is read at the moment execute()
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
Notes: BindParam binds only to placeholders in the prepared statement; parameters can be re-bound before execute.