0

I am using phpactiverecord. We have a table without a primary key and method save() generated this error:

Notice: Undefined offset: 0 in /home/vasiliy/sites/api/lib/ActiveRecord/lib/Model.php on line 573

In line 573 phpactiverecord, it tries to use the primary key value, but it is not set because the table does not have a primary key.

What can I do if my table has no primary key?

4

1 回答 1

3

php-activerecord 需要主键,你无能为力。因此,要么将主键添加到表中(这可能是一个非常好的主意),要么不使用 activerecord 来完成这项工作。

于 2012-05-10T16:13:07.377 回答