update : 2015.11.03
php.shukuma.com

검색:
 
 
Frees all resources for the specified statement

sqlsrv_free_stmt

(No version information available, might only be in Git)

sqlsrv_free_stmtFrees all resources for the specified statement

설명

bool sqlsrv_free_stmt ( resource $stmt )

Frees all resources for the specified statement. The statement cannot be used after sqlsrv_free_stmt() has been called on it. If sqlsrv_free_stmt() is called on an in-progress statement that alters server state, statement execution is terminated and the statement is rolled back.

인수

stmt

The statment for which resources are freed. Note that NULL is a valid parameter value. This allows the function to be called multiple times in a script.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

Example #1 sqlsrv_free_stmt() example

<?php
$serverName 
"serverName\sqlexpress";
$connectionInfo = array( "Database"=>"dbName""UID"=>"username""PWD"=>"password");
$conn sqlsrv_connect$serverName$connectionInfo);
if( 
$conn === false ) {
     die( 
print_rsqlsrv_errors(), true));
}

$stmt sqlsrv_query$conn"SELECT * FROM Table_1");
if( 
$stmt === false ) {
     die( 
print_rsqlsrv_errors(), true));
}

/*-------------------------------
     Process query results here.
-------------------------------*/

/* Free the statement resources. */
sqlsrv_free_stmt$stmt);

?>

주의

The main difference between sqlsrv_free_stmt() and sqlsrv_cancel() is that a statement resource cancelled with sqlsrv_cancel() can be re-executed if it was created with sqlsrv_prepare(). A statement resource cancelled with sqlsrv_free_statement() cannot be re-executed.

참고