-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