PHP mysqli: commit() function
mysqli_commit() function / mysqli::commit
The mysqli_commit() function / mysqli::commit commits the current transaction for the specified database connection.
Syntax:
Object oriented style
bool mysqli::commit ([ int $flags [, string $name ]] )
Procedural style
bool mysqli_commit ( mysqli $link [, int $flags [, string $name ]] )
Parameter:
Name | Description | Required/Optional |
---|---|---|
link | A link identifier returned by mysqli_connect() or mysqli_init() | Required for procedural style only. Optional for Object oriented style |
flag | A bitmask of MYSQLI_TRANS_COR_* constants. | Required |
name | If provided then COMMIT/*name*/ is executed. | Required |
Usage: Procedural style
mysqli_commit(connection);
Parameter:
Name | Required/Optional | Description |
---|---|---|
connection | Required | Specifies the MySQL connection to use. |
Return value:
Returns TRUE on success or FALSE on failure.
Version: PHP 5, PHP 7
Example of object oriented style:
Example of procedural style:
See also
Previous: close
Next: connect_errno