我试图在存储在不同文件夹中的 div 3 缩略图中显示。
在我的 bd 中确定(值为“1”)哪个记录有图片。所以这是我的数据库:
+------+----------------+---------+--------+--------+
| ID | BRAND | PHP | RUBY | JAVA |
+------+----------------+---------+--------+--------+
| 1 | ford | 1 | 0 | 0 |
+------+----------------+---------+--------+--------+
| 2 | seat | 1 | 1 | 1 |
+------+----------------+---------+--------+--------+
| 3 | fiat | 1 | 1 | 0 |
+------+----------------+---------+--------+--------+
| 4 | toyota | 1 | 0 | 0 |
+------+----------------+---------+--------+--------+
| 5 | vw | 1 | 0 | 1 |
+------+----------------+---------+--------+--------+
选择记录:
$result = mysqli_query($connecDB,"SELECT * FROM brands WHERE php = '1' OR ruby = '1' OR java = '1' ORDER BY id ASC");
while($row = mysqli_fetch_assoc($result)){
$new_array[] = $row;
}
但我的问题是:我如何选择值“1”以及如何知道哪个是哪个?
也许我可以使用:$row['php'] $row['java'] $row['ruby']
但是如何过滤值“0”?