Hi,
Somehow I downloaded an example, modified and uploaded to server, also connected to mysql database.
Php properly is working here insertareg.php
Im 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
<html>
<head>
<title>Data of Sensor</title>
</head>
<body>
<h1>Data from the temperature and moisture sensors</h1>
<form action="add.php" method="get">
<TABLE>
<tr>
<td>P Line</td>
<td><input type="text" name="temp1" size="20" maxlength="30"></td>
</tr>
<tr>
<td>Trays</td>
<td><input type="text" name="moi1" size="20" maxlength="30"></td>
</tr>
</TABLE>
<input type="submit" name="accion" value="Grabar">
</FORM>
<hr>
<?php
include("conec.php");
$link=Conection();
$result=mysql_query("select * from tempmoi order by id desc",$link);
?>
<table border="1" cellspacing="1" cellpadding="1">
<tr>
<td> P Line </td>
<td> Trays </td>
</tr>
<?php
while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s </td><td> %s </td></tr>", $row["temp1"], $row["moi1"]);
}
mysql_free_result($result);
?>
</table>
</body>
</html>