Unable to connect sqlsrv php call stored procedure -


i took below sp hit using sqlsrv , php. snippet not worked me. below code getting " sql srv query not ran ". please provide advise, how achieve php + sqlsrv + sp.

$query = "{call call_user_name}";  if ( ($res = sqlsrv_query( connstr, $query)) ) {        {       if ( sqlsrv_num_fields($res) ) // 1 way check if results returned.        {          while( ($row = sqlsrv_fetch_array( $res, $type)) )          {             $data[] = $row;           }       }else{echo "sqlsrv_num_fields not working";}    } while ( sqlsrv_next_result($res) ) ;    sqlsrv_free_stmt($res); // not essential, form if script lots of other stuff. }else{        echo "sql srv query not ran ";die( print_r( sqlsrv_errors(), true)); } 

there possible causes error, suggestion: change line

echo "sql srv query not ran"

to

die( print_r( sqlsrv_errors(), true));

then can see causing error.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -