No edit summary |
m (refresh SMW properties) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{smcfunc | {{smcfunc | ||
|function=db_transaction | |function=db_transaction | ||
|internal=true | |||
|usage=$smcFunc['db_transaction'] (type, connection) | |usage=$smcFunc['db_transaction'] (type, connection) | ||
|description=Same as calling queries for "BEGIN", "ROLLBACK", and "COMMIT". | |description=Same as calling queries for "BEGIN", "ROLLBACK", and "COMMIT". | ||
Line 25: | Line 26: | ||
$smcFunc['db_transaction']('commit');</nowiki> | $smcFunc['db_transaction']('commit');</nowiki> | ||
}} | }} | ||
<noinclude> | <noinclude> | ||
[[Category:Database Functions]]</noinclude> | [[Category:Database Functions]]</noinclude> |
Latest revision as of 16:43, 11 October 2012
Usage:
$smcFunc['db_transaction'] (type, connection)
This function should never be used outside the database abstraction layer (Db-*.php or Subs-Db-*.php files) |
Description: Same as calling queries for "BEGIN", "ROLLBACK", and "COMMIT".
Parameters:
- type A string defining the type of transaction. It can be one of the following: begin, rollback or commit. Default is commit.
- connection the database connection.
Return: true on success, false on error.
Example:
$smcFunc['db_transaction']('begin'); // Do the table and indexes... $smcFunc['db_query']('', $table_query, array( 'security_override' => true, ) ); foreach ($index_queries as $query) $smcFunc['db_query']('', $query, array( 'security_override' => true, ) ); $smcFunc['db_transaction']('commit');