Posts Tagged: PDO

PDO – bindParams vs. bindValues

Posted by & filed under OOP.

I was trying to supply binding params to a PDO query like this: However, this will not work. From the PHP manual – “Unlike PDOStatement::bindValue(), the variable is bound as a reference and will only be evaluated at the time that PDOStatement::execute() is called.” So, the correct way to do this would be: See also,… Read more »