列名必须是字符串或数组 yii

列名必须是字符串或数组 yii

问题描述:

我在访问 yii 的 Web 应用程序时遇到了一些问题.我已配置为与所有者的设置相同,但是当我尝试访问时,出现错误列必须是字符串或数组".我怎么能解决呢?提前致谢..

i got some stuck when accessing a yii's web application. I have configured as the same as the owner's setting, but while i tried to access, i got an error "Column must be either a string or an array". How could i solve it? Thanks in advance..

在报告错误消息时,它有助于获得准确的错误消息.实际的错误消息是:列 name 必须是字符串或数组".使用确切的字符串,您可以搜索框架文件以找到提及它的位置.

When reporting error messages, it helps to have the precise error message. The actual error message is: "Column name must be either a string or an array". With an exact string you can search the framework files to find where it is mentioned.

看起来某处的某些方法正在将无效的列名传递给 CDbCommandBuilder 的 createInCondition 方法.

Looks like some method somewhere is passing an invalid column name to createInCondition method of CDbCommandBuilder.

见第 722 行:https://github.com/yiisoft/yii/blob/1.1.13/framework/db/schema/CDbCommandBuilder.php

查看调用该方法的几个实例,我猜您有一个没有主键的数据库表.这是对该问题的一种可能解释.其他解释需要您提供更多详细信息.

Looking at a couple instances where that method is called, I would guess that you have a database table without a primary key somewhere. That is one possible explanation for the problem. Other explanations will require a lot more details on your part.

提供错误页面在调试模式下为您提供的堆栈跟踪以及您的表架构.

Provide the stack trace that the error page provides you with when in debug mode along with your table schema.