-1
I have a table that, time the value is negative and, time is positive. I would like these values to be green or red. But, I couldn’t do it. Currently my select is being presented this way:
(php, myadmin, pdo)
<?php
$sql = $pdo->prepare("SELECT sum(premio) as premio from home
WHERE id_user = :id_user;");
$sql->bindValue(":id_user", $id);
$sql->execute();
if ($sql->rowCount() > 0) {
foreach ($sql->fetchAll() as $item) {
?>
<tr>
<th>Ganho</th>
<td> R$ <?php echo $item['premio'];?></td>
</tr>
<?php
}
}
?>
Welcome Gabriel Alves to the Stack Overflow in English. Cãso not to take a tour of the Sita in have done it would be interesting https://answall.com/tour
– user60252