I am new to PHP. When writing the content of the search box, I found that I cannot query multiple conditions at the same time. Could anyone please give me some ideas on how to write it? I am grateful for
# This is the pHP content written below:
& LT *) as total from tb_file where f_type=1"; //Find published content
$sql = mysqli_query($conn,$inquire);
$result = mysqli_fetch_assoc($sql ; # <td colspan="8" class="text-center">No query content yet, please search again</td>
Pagination class
! How to query multiple conditions at the same time$inquireCon = "select * from tb_file where f_qualitynum like '%$fileNum%' or f_filename like '%$fileName%' or f_department='$department' or f_classify='$qualityfile' order by f_date desc limit ".$page->limit()."";
$sqlCon = mysqli_query($conn, $inquireCon);
while($resultCon = mysqli_fetch_assoc($sqlCon)){
?>
<tr>
<td class="text-center" style="vertical-align: middle;"><input type="checkbox" name=""></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_qualitynum']; ?></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_filename']; ?></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_classify']; ?></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_grade']; ?></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_department']; ?></td>
<td class="text-center" style="vertical-align: middle;"><?php echo $resultCon['f_date']; ?></td>
<td class="text-center" style="vertical-align: middle;"><input type="text" name="download" class="btn btn-default btn-xs" style="width: 50%;" value="下载" style="width: 80%;"></td>
</tr>
<?php
}
}
?>
WJ2020-05-27 17:14:36
if (strlen($SO['cate_id'])) { $filter[] = [ 'cate_label', 'like', "%," . trim($SO['cate_id']) . ",%" ]; } if (strlen($SO['audit'])) { $filter[] = [ 'audit', '=', $SO['audit'] ]; } if ($SO['title']) { $filter[] = [ 'title', 'like', "%" . trim($SO['title']) . "%" ]; }
Let’s see if something like this works. This is how tp is written. For native, use splicing. I haven’t written native for a long time.
逆旅行人2019-06-22 22:56:37
According to the data obtained, if it is not empty, the splicing conditions will be fine.