3
I’m starting up PHP.
I intend to present the hours and minutes stored in a field but when I read it what it presents is something like: 01:00:00.0000000
.
The SQL field is time(7) and the variable I’m reading to is: $row["horas_assis"]
.
How should I do to present only the hours and minutes?
<table class="lista" align="center" width="100%" cellspacing="2" cellpadding="5">
<tr>
<th width="22%">Data</th>
<th width="53%">Cliente</th>
<th width="15%">Horas</th>
<th></th>
</tr>
<?php
$conn = ligarbd("assistec");
$SQL = "SELECT * FROM assistencias WHERE id_tec=$id_tec";
$result = odbc_exec($conn,$SQL);
while($row = odbc_fetch_array( $result )){
?>
<tr>
<td><h7><?=$row["data"]?></h7></td>
<td><?=$row["id_cli"]?></td>
**<td><?=$row["horas_assis"]?></td>**
<td>
<a href="assistencias.php?id=<?=$row['id_tipo']?>&tipo=0"><img src="img/alterar_tec.png" alt="Editar"></a>
<a href="assistencias.php?id=<?=$row['id_tipo']?>&tipo=1"><img src="img/apag_tec.png" alt="Apagar"></a>
</td>
</tr>
<?php
}
odbc_close();
?>
</table>
Thanks! Solved the situation.
– p9adi