Changing the table cell color depending on inserting value

I downloaded an example, modified it and uploaded to the server. Also connected to mysql database.
Php properly working here
I’m new to PHP, just only know very little and earning by changing example codes.

Want to do this:
Only ( 0,1,2,3) will be inserted into Trays column and cells of the Trays column should
change according to the inserting values as this

o - red
1 - orange
2 - yellow
3 - green

With the color of the cell number also should be displayed in each cell of Trays column.

Help modifying the code


Data of Sensor

Data from the temperature and moisture sensors

P Line

<?php include("conec.php"); $link=Conection(); $result=mysql_query("select * from tempmoi order by id desc",$link); ?> <?php while($row = mysql_fetch_array($result)) { printf("", $row["temp1"], $row["moi1"]); } mysql_free_result($result); ?>
 P Line    Trays  
 %s  %s 

I was trying to look at this… but this line


Is driving me nuts and I can’t test your code, because it keeps refreshing the screen every 5 seconds

That made me dizzy too ??? Btw did you fix this? Or do you still need help?

Sponsor our Newsletter | Privacy Policy | Terms of Service