Mysql
 SQL >> Datenbank >  >> RDS >> Mysql

Cannot pass parameter 2 by reference mit bindParam beheben

Du brauchst bindValue, nicht bindParam.

bindParam nimmt eine Variable per Referenz und liest ihren Wert nicht zum Zeitpunkt des Bindens.

bindValue(':param', null, PDO::PARAM_INT);

Hinweis: bindValue(':param', null, PDO::PARAM_NULL); funktioniert nicht in allen Fällen zuverlässig.