I have a table with 5 columns and 2 records. One of the fields in the record is a number (noteQualif), I need the field in which it is inserted to be painted green if it is larger than 75 and painted red if it is smaller than 75.
All data is stored in a database created in phpmyadmin, so it is necessary that when the user enters data, the note Queualif is checked and soon painted in green or red.
I leave here the code made so far that it looks at the table with the data.
<head><title>Ver registos</title></head>
<?php
LigarBDfater(); //connect to the database
// get results from database
$result = mysql_query("SELECT * FROM qualificacao") or die(mysql_error());
// display data in table
echo "<p><b>View All</b> | <a href='view-paginated.php?page=1'>View Paginated</a></p>";
echo "<table border='1' cellpadding='10'>";
echo "<tr><th>ID Qualificação</th> <th>ID Fornecedor</th> <th>Nome Funcionario</th> <th>Nota Qualificação</th> <th>Data Qualificação</th></tr>";
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array($result)){
// echo out the contents of each row into a table
echo "<tr>";
echo '<td>' . $row['id_qualific'] . '</td>';
echo '<td>' . $row['id_fornecedor'] . '</td>';
echo '<td>' . $row['nomeFuncionario'] . '</td>';
echo '<td>' . $row['notaQualif'] . '</td>';
echo '<td>' . $row['dataQualif'] . '</td>';
echo "</tr>";
}
// close table>
echo "</table>";
?>
<p align="left"><a href="novo_qualificacao.php">Adicionar um novo registo</a></p>