Home >Backend Development >PHP Tutorial >Why didn't I query it when I used fuzzy query? It displayed all the data by itself?
I haven’t submitted the query conditions yet. Every time I open this page, all the data in the user table is displayed. If fuzzy query is not used, this situation will not happen. Why is this?
<code>$sql="SELECT * FROM user WHERE name like '%{$name}%'";</code>
I haven’t submitted the query conditions yet. Every time I open this page, all the data in the user table is displayed. If fuzzy query is not used, this situation will not happen. Why is this?
<code>$sql="SELECT * FROM user WHERE name like '%{$name}%'";</code>
If no query conditions are submitted
Then the sql is like this
<code>SELECT * FROM user WHERE name like '%%';</code>
This request will of course display all the data
No reason, it’s just like this