Applying background color to single cell based on php value

  Kiến thức lập trình

I am relatively new to php and cannot figure out why the background-color value is being applied to all cells rather than just the one. My “Admin Page” is able to save a value called ‘color’ in SESSION. I then use that value and echo it to select the appropriate color based on the button I selected [Red/red, Yellow/yellow, etc]. However when I select a color, it applies that same color to all cells within the ‘Ref’ column.

Admin Page

Ref Cells


I am thinking it may have something to do with resetting the value back to white after I have finished using it but cannot seem to find the correct placement or command for this. Any support would be greatly appreciated.

New contributor

Aaron Linan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.