How to solve the problem that the where condition in the query database has fields, but the query is empty

一个新手
Release: 2023-03-16 14:12:02
Original
3782 people have browsed it


This is a problem encountered in the ThinkPHP framework

The reason for this is:
There is a problem when writing the where statement:

eg: select datatype from t_loop where address = 2/2/41; 框架中where('address='.$address)
Copy after login

This query is empty,

select datatype from t_loop where address = '2/2/41'; 框架中where(['address'=>$address])
Copy after login

This query has a value

The above is the detailed content of How to solve the problem that the where condition in the query database has fields, but the query is empty. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!