What is the difference between bindParam and bindValue?

From the manual entry for PDOStatement::bindParam: [With bindParam] Unlike PDOStatement::bindValue(), the variable is bound as a reference and will only be evaluated at the time that PDOStatement::execute() is called. So, for example: $sex = ‘male’; $s = $dbh->prepare(‘SELECT name FROM students WHERE sex = :sex’); $s->bindParam(‘:sex’, $sex); // use bindParam to bind the variable $sex … Read more