How can get data from a SQL view using SQLSRV PHP 5.3 and IIS7?

355 views Asked by At

This is my query

    $sqlq= "select * from [reloj].[dbo].[VistaChecador]";

    $t_mov=sqlsrv_query($conn, $sqlq );
    if( $t_mov === false) {
        die( print_r( sqlsrv_errors(), true) );
    }

    while ($row4=sqlsrv_fetch_array($t_mov, SQLSRV_FETCH_NUMERIC)) {
        print " $row4[0], $row4[1]";                
    }
    ...

This is a SQL view [reloj].[dbo].[VistaChecador] and didn't show any result. Before I was MsSql with a PHP 5.2, but I migrate to new server.

If I use this:

    $sqlq= "select * from [reloj].[dbo].[EMPLEADOS]";

    $t_mov=sqlsrv_query($conn, $sqlq );
    if( $t_mov === false) {
        die( print_r( sqlsrv_errors(), true) );
    }

    while ($row4=sqlsrv_fetch_array($t_mov, SQLSRV_FETCH_NUMERIC)) {
        print " $row4[0], $row4[1]";
    }

The Web show me the data, but the table [reloj].[dbo].[EMPLEADOS] is not an SQL view. Any pointers of what's I am doing wrong?

0

There are 0 answers