I use a FTP site to upload my work, which resides on a server running on a Linux OS based on nginx. And I use an odbc driver to connect to a database that interacts with my php code. In that database exists a date column type that returns the full date & time. I need to retrieve just the date. I used the CONVERT
function convert(varchar(10), date_col, 110)
and get the needed result using it withAptanaStudio as my IDE. But my php code returns an empty field. What have I done wrong?
The code:
<?php
$odbc = odbc_connect(...);
$odbc_res = odbc_exec($odbc, "select convert(varchar(10), rep_date, 110) from table");
?>
<table>
<thead>
<th>Date is:</th>
</thead>
<tbody>
<?php $r = odbc_fetch_array($odbc_res_c) ?>
<tr>
<td><?= $r['rep_date'] ?></td>
</tr>
</tbody>
</table>