Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $serverName = "server";
- $connectionInfo = array("UID"=> "user", "PWD" =>"pass", "Database"=>"sample_db");
- $conn = sqlsrv_connect( $serverName, $connectionInfo);
- if( $conn )
- {
- $sql = "db_AbbTest";
- $r = sqlsrv_query($conn, $sql, null, array(
- 'Scrollable' => SQLSRV_CURSOR_STATIC,
- 'SendStreamParamsAtExec' => true
- ));
- var_dump($r);
- while( $obj = sqlsrv_fetch( $r))
- {
- var_dump($obj);
- var_dump(sqlsrv_fetch_array($r));
- }
- echo "Connection established.\n";
- }
- else
- {
- echo "Connection could not be established.\n";
- die( print_r( sqlsrv_errors(), true));
- }
- //-----------------------------------------------
- // Perform operations with connection.
- //-----------------------------------------------
- /* Close the connection. */
- sqlsrv_close( $conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement