使用html FORM
let's convert $core
in 100
and $mhz
in 1000
emag
and koyos
are table rows
So if $core
is set $parameters['emag'] = "$core";
is emag=100
else it is null
AND
and WHERE
are dinamicly set to appear,所以问题是我收集了变量的所有数据$parameters[]
和foreach()
它们。
使用我的代码,我得到了确切$core
的信息。这是代码:
if (!empty($core)) {
$parameters['emag'] = "$core";
}
if (!empty($mhz)) {
$parameters['koyos'] = $mhz;
}
$sql = "SELECT * FROM $tbl_name WHERE 1=1 ";
if (!empty($parameters)) {
foreach ($parameters as $k => $v) {
$sql .= " AND " . $k . "='" . $v . "'";
}
}
$sql .= " ORDER BY emag, performanta_cpu_core DESC, performanta_cpu DESC LIMIT $start, $limit";
结果只是带有 的行,emag=100
但我需要所有数字都等于或小于100
100