我将如何缩短这个 mysql 查询以便在 php 中使用?
<?php
$sql = "SELECT * FROM $this->usernameid where
name LIKE '%$term%' OR
manufacture1 LIKE '%$term%' OR
manufacture2 LIKE '%$term%' OR
manufacture3 LIKE '%$term%' OR
manufacture4 LIKE '%$term%' OR
manufacture5 LIKE '%$term%' OR
manufacture6 LIKE '%$term%' OR
manufacture7 LIKE '%$term%' OR
manufacture8 LIKE '%$term%' OR
manufacture9 LIKE '%$term%' OR
manufacture10 LIKE '%$term%'
ORDER BY $order1";
?>
想做一个 while 循环,作为一个例子,我的 $_POST 是程序的另一部分。
<?php
$i = 1;
while ($i < 10) {
$manufacture[$i] = strtoupper(filterinput($_POST['manufacture' . $i]));
$i++;
};
?>