thinkphp mode's find method fails

巴扎黑
Release: 2016-11-11 09:40:27
Original
1310 people have browsed it

I encountered a strange problem today

Using the D('Custoemr')->find(1) statement, no sql is executed, which is very strange.

The find method using models from other tables works fine. Combined with the D('Custoemr')->add() method, the primary key is not returned.

I felt that the problem should be with the primary key, so I carefully checked the customer table and found that there were indeed two primary keys. One of them was clicked on by mistake.


So here’s a summary again, if there is a table with multiple primary keys, then neither the find nor create methods will execute normally

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