I'm trying to show in a div 3 thumbnails stored in different folders.
In my bd determined (with value "1") which record has pictures. So this is my db:
+------+----------------+---------+--------+--------+
| 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 |
+------+----------------+---------+--------+--------+
Selecting records:
$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;
}
But my problem is: How I can select the values "1" and how to know which is which?
Maybe I could use: $row['php'] $row['java'] $row['ruby'] But how to filter the values "0"?
WHERE 1 IN (PHP, RUBY, JAVA).