Как запустить изменение компонента из другого компонента?

Простой, значение bindParam может измениться, но значение bindValue не может измениться. Пример:

$someVal=10;
$someVal2=20;
/* In bindParam, the value argument is not bound and 
will be changed if we change its value before execute.
*/
$ref->bindParam(':someCol',$someVal);
$someVal=$someVal2;
$ref->execute();
//someCol=20
/* In bindValue, the value argument is bound and 
never changed if we change its value before execute.
*/
$ref->bindValue(':someCol',$someVal);
// here assignment is referral (&$someVal)
$someVal=$someVal2;
$ref->execute();
//someCol=10
1
задан K D 26 February 2019 в 18:03
поделиться