How to execute a stored procedure in php using sqlsrv and “?” style parameters

The user contributions on the php.net have a write up on how to execute a stored procedure using the sqlsrv-prepare. In case that is removed from the php.net user contributions in the future here is what it had(has) listed: $procedure_params = array( array(&$myparams[‘Item_ID’], SQLSRV_PARAM_OUT), array(&$myparams[‘Item_Name’], SQLSRV_PARAM_OUT) ); // EXEC the procedure, {call stp_Create_Item (@Item_ID = … Read more

sqlsrv_num_rows Not Returning Any Value

It is because sqlsrv_query() uses SQLSRV_CURSOR_FORWARD cursor type by default. However, in order to get a result from sqlsrv_num_rows(), you should choose one of these cursor types below: SQLSRV_CURSOR_STATIC SQLSRV_CURSOR_KEYSET SQLSRV_CURSOR_CLIENT_BUFFERED For more information, check: Cursor Types (SQLSRV Driver) In conclusion, if you use your query like: $query = sqlsrv_query($conn, $result, array(), array( “Scrollable” => … Read more