Cannot pass parameter 2 by reference error in php PDO -


I'm getting the error: Can not go into context with parameter 2 .....

In this line ...

  $ stmt1- & gt; Dam (': value', $ _SESSION ['quantity'. $ I] * $ _SESSION ['value'. $ I], PDO :: PARAM_STR);  

What's wrong with the code above ??

It expects the second parameter is a variable that can be passed from context. Assume that $ stmt1 is a PDO statement, such as BindParam

Unlike the PDOSTattement :: Bind value (), the variable is bound as a reference And only PDOStatement :: execute () is evaluated on time.

Your second ultimate one expression is ( $ _ session ['quantity'. $ I] * $ _SESSION ['value'. $ I] ) A variable Not because you want to evaluate the expression now, I think you should use bindValue () instead.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -