Home  >  Article  >  Backend Development  >  thinkphp mode's find method fails

thinkphp mode's find method fails

巴扎黑
巴扎黑Original
2016-11-11 09:40:271312browse

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

Statement:
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