odbc_autocommit

FunctionParams changed in PHP 8.4

Toggle autocommit behaviour.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
PHP 8.2-8.3
PHP 8.4
Improved
PHP 8.5
PHP 8.6

odbc_autocommit Function synopsis

odbc_autocommit(Odbc\Connection $odbc, ?bool $enable = null): int|bool

Parameters

$odbc

TypeOdbc\Connection

$enable

OptionalType?boolDefault valuenull

If $enable is true, auto-commit is enabled, if it is false auto-commit is disabled. If null is passed, this function returns the auto-commit status for $odbc.

Return value

Typeint|bool

With a null $enable parameter, this function returns auto-commit status for $odbc. Non-zero is returned if auto-commit is on, 0 if it is off, or false if an error occurs.

If $enable is non-null, this function returns true on success and false on failure.

Changes to the odbc_autocommit Function

PHP 8.4

  • Parameter type added for parameter #1 ($odbc): Odbc\Connection
- odbc_autocommit($odbc, ?bool $enable = null): int|bool
+ odbc_autocommit(Odbc\Connection $odbc, ?bool $enable = null): int|bool

PHP 8.3

  • Parameter type changed for parameter #2 ($enable): bool to ?bool
  • Parameter default value changed for position #2 ($enable): false to null
- odbc_autocommit($odbc, bool $enable = false): int|bool
+ odbc_autocommit($odbc, ?bool $enable = null): int|bool

PHP 8.0

  • Return type added: int|bool
  • Parameter name of parameter #1 changed: $connection_id to $odbc
  • Parameter name of parameter #2 changed: $onoff to $enable
  • Parameter type added for parameter #2 ($enable): bool
  • Parameter default value added for position #2 ($enable): false
- odbc_autocommit($connection_id, $onoff)
+ odbc_autocommit($odbc, bool $enable = false): int|bool

odbc_autocommit Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes