I downloaded the latest tp3.2.3, and I encountered problems when executing statements
It’s where or add or update,
Parameter errors will not be reported, but will be filtered out directly. I would like to ask, is it a problem with my configuration?
Question: <1> For example, the user table field username password. When I added, I wrote username as usernames. As a result, the statement was successful, but only password was inserted
<2> Querying the user table, in my where condition, I deliberately wrote array('username'=>'aaa') as array('usernames'=>'aaa')
The resulting SQL was directly filtered into an empty condition , that is, it becomes select * from user ;
Debug is turned on, indicating that errors will be reported, but field errors will not be reported! When printing the last SQL statement, all the wrong fields or conditions displayed were filtered out.
I downloaded the latest tp3.2.3, and I encountered problems when executing statements
It’s where or add or update,
Parameter errors will not be reported, but will be filtered out directly. I would like to ask, is it a problem with my configuration?
Question: <1> For example, the user table field username password. When I added, I wrote username as usernames. As a result, the statement was successful, but only password was inserted
<2> Querying the user table, in my where condition, I deliberately wrote array('username'=>'aaa') as array('usernames'=>'aaa')
The resulting SQL was directly filtered into an empty condition , that is, it becomes select * from user ;
Debug is turned on, indicating that errors will be reported, but field errors will not be reported! When printing the last SQL statement, all the wrong fields or conditions displayed were filtered out.
Print sql:echo $this->getLastSql() in the model file to see the execution statement.
Is debug mode turned on?
This is the filtering effect of thinkphp. add() will filter out fields that do not meet the requirements. If you ask this question, it means you didn't read the documentation carefully.
thinkphp can filter out your wrong fields. He only writes the correct fields in. No errors are reported. He will treat it as if you did not pass this field