Home > Article > Backend Development > thinkphp mode's find method fails
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