Hey! I’m trying to use some data on a PHP table to display different buttons on my website, but I’m facing some issues when trying to do this. Here is my HTML code and some screenshots:
I’d like that these buttons under Status column display different colors and icons for different values on the column marked with red on the PHP table.
Basically, it should be red with a xmark if the value is “Negado”; green with a checkmark if the value is “Ativo” and yellow with a question mark if the value is “Pendente”. I really don’t know what I’m missing in the code. (I’m a newbie, don’t judge me hahahaha)
it seems that you are trying to generate buttons dynamically based on the $array->usr_status value. However, there are a few syntax errors in your code. Here’s a corrected version of the code:
:::::::::: In PHP, string values should be enclosed in quotes. Therefore, you should use 'Pendente' , 'Ativo' , etc., instead of just Pendente , Ativo , etc., in your conditionals:
With these corrections, the button class and icon class will be dynamically generated based on the value of $array->usr_status .
i will be happy if i hear you code is working!.
idk if you are not seeing the code just contact me at “[email protected]”