Home > Backend Development > PHP Tutorial > thinkphp mode的find方法失灵

thinkphp mode的find方法失灵

WBOY
Release: 2016-06-13 12:21:05
Original
1107 people have browsed it

thinkphp mode的find方法失效
今天遇到一个奇怪的问题

使用 D('Custoemr')->find(1)语句没有sql执行,非常奇怪。

而用其他表的model的find方法却正常。再结合D('Custoemr')->add()方法不返回主键。

觉得问题应该出在主键上,于是再仔细检查customer表发现果不其然有两个主键。 其中一个是手误点上去的。


所以这里再次总结下,如果有表有多个主键,那么find和create方法都不会正常执行

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template