Home > Backend Development > PHP Tutorial > thinkphp problem

thinkphp problem

WBOY
Release: 2016-09-06 08:57:08
Original
1003 people have browsed it

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.

Reply content:

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

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