Project Pages

objSQL Home
Freshmeat
PHP Classes
SourceForge
Downloads
Archived Documentation

DB Connection Methods

objSQL
obj_close

Error Handling Methods

obj_error
obj_error_message

Statement Methods

obj_delete
obj_insert
obj_paging
obj_query
obj_select
obj_update

Resultset Methods

obj_affected_rows
obj_fetch_assoc
obj_fetch_num
obj_fetch_object
obj_field
obj_free_result
obj_num_fields
obj_num_rows

Prepared Statement Methods

obj_bind
obj_execute
obj_free_statement
obj_prepare_statement

Transaction Methods

obj_commit
obj_rollback
obj_savepoint
obj_transaction

Utility Methods

obj_escape
obj_info
obj_row_count


obj_close_statement

Description:

Closes a prepared statement and releases all result resources.

  • Executing a prepared statement after calling obj_close_statement will throw an exception.

Parameters:

bool obj_close_statement ( void )


Returns:

True on success or false on failure.


Example:

<?php  

try  
{  
    
$stmt $dbh->obj_prepare_statement"update mytable set dept=? where location=?" );  
      
    
$stmt->obj_bind'Sales' );  
    
$stmt->obj_bind'Chicago' );    
      
    
$rs $stmt->obj_execute();    
      
    if ( 
$dbh->obj_error() )  
        throw new 
Exception$dbh->obj_error_message() );  
          
    echo 
$rs->obj_affected_rows();  
     
    
$stmt->obj_close_statement(); 
     
}  
catch ( 
Exception $e )   
{  
    
//log error and/or redirect user to error page  
}   

?>

See also: obj_prepare_statement