In PHP, binds a value to a corresponding named or question mark parameter in the SQL statement that was used to prepare the statement.
Binds a value to a corresponding named or question mark parameter in the SQL statement that was used to prepare the statement.
public bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] )
Example #1 Execute a prepared statement with named parameter
<?php
/* Execute a prepared statement by binding values */
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->bindValue(':calories', $calories, PDO::PARAM_INT);
$sth->bindValue(':colour', $colour, PDO::PARAM_STR);
$sth->execute();
?>
Reference