ads_rollback

Advantage PHP Extension

  Previous topic Next topic  

Rolls back the active transaction for the given connection.

Syntax

boolean ads_rollback( resource connection_id )

Parameters

connection_id (I)

ID of a connection to the Advantage Database Server.

Remarks

Calling ads_rollback when the Advantage PHP Extension is not in auto-commit mode rolls back the active transaction on the given connection and begins a new transaction. If the Advantage PHP Extension is in auto-commit mode, calling ads_rollback has no effect and True is returned. If the active transaction is successfully rolled back, True is returned. False is returned in the event of an error.

Example

<?

echo "Connecting to Server<br>\n";

$rConn = ads_connect( "DataDirectory=\\\\server1\\share1\\data\\;ServerTypes=2", "", "" );

echo "Connected<br>\n";

 

echo "Turning off auto-commit. Starts a transactions.<br>\n";

ads_autocommit( $rConn, False );

 

echo "Updating the customers credit limit.<br>\n";

$rResult = ads_do( $rConn, "UPDATE customers SET credit_limit = ( credit_limit * 2 )" );

 

echo "Rolling back the changes.<br>\n";

ads_rollback( $rConn );

 

echo "Closing the connection<br>\n";

ads_close( $rConn );

echo "Disconnected<br>\n";

?>

See Also

ads_autocommit

ads_commit

ads_connect