Joke Collection Website - Blessing messages - Yii2 Why does storing data in an array lead to setting unknown properties?
Yii2 Why does storing data in an array lead to setting unknown properties?
When using Yii2 framework, if the query data is stored in an array, you want to add a new subscript to the array. If the new subscript name does not exist in the data table field used by the model, an error will be issued as shown in the title.
Solve:
Method 1: define variables with subscript names in the model;
Method 2: When fetching data, use asArray () to save the result as a pure array.
- Related articles
- What should I do if I forget my password in pea pods and my mobile phone can't receive SMS? Urgent!
- There is no Lacarra pos machine. Why do you want to change the machine to send text messages?
- Brief introduction of chengguan tong
- What about Zhengzhou Hexin Engineering Testing Technology Co., Ltd.?
- Love quotations for you who suddenly want to fall in love.
- What does the stepmother mean by sending this text message?
- Apple's mobile phone received the WeChat payment verification code, saying that I was using the Appstore for confidential transactions. As a result, the money in the bank card was gone
- How does Apple turn off the incoming flash?
- How to tactfully remind your ex-boyfriend to pay back the money?
- Teachers' Day greetings from female teachers.