-2
我正在研究一個過濾系統,它只會顯示符合特定條件的結果。查詢只顯示列值名稱
用戶使其「過濾器」將該首選項添加到過濾器表中。列名是條件。
我想顯示一個表格,其中表頭列僅顯示匹配條件'on'和off爲空的列。
function get_filter_columns($filter_id) {
$result = mysql_query('SELECT * FROM filters WHERE id="$filter_id"') or die(mysql_error());
echo '<thead>
<tr>';
// echo mysql_fetch_array($result);
echo count($result, COUNT_RECURSIVE);
while($row = mysql_fetch_array($result)) {
$counter++;
echo '<th>'.$row['total'].'</th>';
echo mysql_field_name($result, $counter);
}
echo '</tr>
</thead>';
}
那麼,什麼是問題? – barbashov 2013-04-09 18:04:27
@barbashov如何列出列表中只包含字符串「on」的所有列名稱 – 2013-04-09 18:38:42
您是指包含字符串「on」的列名稱? – barbashov 2013-04-09 20:30:07