Answer the question
In order to leave comments, you need to log in
How to properly bindParam() in Yii1?
There are JSON format records in the table, you need to find data in these records by condition.
I did Yii::app()->db->createCommand(), then select, from and add a condition:
andWhere('myTable.json LIKE \'%"phone":"' . $this->getPhone() . '"%\'');
This option works, but I need to do it with bindParam(),
andWhere('myTable.json LIKE \'%"phone"\:":searchPhone"%\'',[
':searchPhone' => $this-> getPhone()
]);
I get the error invailid parameter number: number of bound variables does not mathc number of tokens
What could be the problem?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question