$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => "http://localhost/staff/home.php",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
curl_close($ch);
$decodeData = json_decode($result);
print_r($decodeData);
答案 0 :(得分:2)
在文字使用的任何地方搜索字符串'%':
$sql="SELECT * FROM test WHERE Name LIKE '%".trim($params['name'])."%'";
答案 1 :(得分:0)
<?php if (!empty($_REQUEST['fname'])){
$params['name']=$_REQUEST['salute']." ".$_REQUEST['fname']." ".$_REQUEST['lname'];
$sql="SELECT * FROM test WHERE Name LIKE '%".trim($params['name'])."%'";
$records=mysqli_query($db->conn,$sql);
while($row=mysqli_fetch_assoc($records)){ ?>
答案 2 :(得分:0)
要进行搜索,您必须在查询中添加%标记:
$sql="SELECT * FROM test WHERE Name LIKE '%".trim($params['name'])."%'";
尝试一下,如果可行,别忘了标记为正确。