Format SQL read variable hours and minutes presentation

Asked

Viewed 365 times

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>

1 answer

2


  • Thanks! Solved the situation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.