I have a simple table view using Bootstrap. I intend to display icons based on the entry of a database field (e.g., the database field is '0', the icon shall be glyphicon-remove, when it is '1' it shall be glyphicon-ok). Is this possible?
Asked
Active
Viewed 333 times
1
-
Yes, make an array in php with icon0 (text) on position [0], icon1 (text) on position [1], etc – Roy Bogado Jun 14 '18 at 13:57
-
easy if/else statement – Metalik Jun 14 '18 at 13:57
-
Yes. Share what you've tried and give some hints about the things not working yet, then we can help you find the error – Nico Haase Jun 14 '18 at 14:01
-
Yes, you can even use CASE WHEN THEN: https://stackoverflow.com/questions/9588015/how-do-i-use-properly-case-when-in-mysql – Michael Eugene Yuen Jun 14 '18 at 14:07
-
I've tried this https://pastebin.com/ac0jKAG1 – Vais Jun 14 '18 at 14:08
-
That looks fine. Have you tried it? – Dave Jun 14 '18 at 15:04
-
It worked after i added a tag. Thank you all – Vais Jun 14 '18 at 23:04