I have an Oracle database that I can access through PHP and visualize information about it, through SQL Developer I have a statement that executes and returns these results:
But executing the same sentence in PHP:
$tsql= "select orden as ORD, fase as FAS, CodMaterial as COD, maquina_id as MAQ, DescMaterial as DES, dhsalida as FEC, scg_MaterialesLotes.lote, scg_MaterialesLotes.lotecli from scg_fases inner join scg_materiales on scg_fases.IdBoletin = scg_Materiales.IdBoletin inner join scg_MaterialesLotes on scg_Materiales.IdMatOf = scg_MaterialesLotes.IdMatOF";
$stmt = sqlsrv_query( $conn, $tsql);
if ( $stmt )
{
?>
<html>
<title>PRUEBA</title>
<body>
<table border = '1'>
<tr>
<th align=center>Orden</th>
<th align=center>Fase</th>
<th align=center>Puesto</th>
<th align=center>Articulo</th>
<th align=center>Descripcion</th>
<th align=center>Fecha</th>
<th align=center>Lote</th>
<th align=center>LoteCli</th>
</tr>
<?php
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC))
{
$orden = $row["orden"];
$fase = $row["fase"];
$puesto = $row["maquina_id"];
$art = $row["CodMaterial"];
$desc = $row["DescMaterial"];
$fecha = $row["dhsalida"];
$lote = $row["scg_MaterialesLotes.lote"];
$loteCli = $row["scg_MaterialesLotes.lotecli"];
echo "<tr>";
echo "<td align=center>" . $orden . "</td>";
echo "<td align=center>" . $fase . "</td>";
echo "<td align=center>" . $puesto . "</td>";
echo "<td align=center>" . $art . "</td>";
echo "<td align=center>" . $desc . "</td>";
echo "<td align=center>" . $fecha . "</td>";
echo "<td align=center>" . $lote . "</td>";
echo "<td align=center>" . $loteCli . "</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
<?php
}
else
{
echo "Submission unsuccessful.";
die( print_r( sqlsrv_errors(), true));
}
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
What it returns to me from the browser is the following:
Why can not I visualize the information the same?