$con=$_POST['con']; $User = M("Activity"); // 实例化User对象 $User->where("LIKE")->select();
How to write the query word in the middle of where() is $con? Please give me an answer
$con=$_POST['con']; $User = M("Activity"); // 实例化User对象 $User->where("LIKE")->select();
How to write the query word in the middle of where() is $con? Please give me an answer
$con=$_POST['con']; $User = M("Activity"); // 实例化User对象 $data['con'] = array('like', "%$con%"); $User->where($data)->select();
This question is relatively elementary. I suggest you take a look at tp’s model about query. document. When the ability reaches a certain level, let's take a look at the code implementation of the TP model. Just go to thinkphp official documentation on Baidu and view the section about querying the model.
The brother on the first floor just saw the invitation and I’m sorry. The brother on the first floor answered perfectly. Just solve it and learn from each other