This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
v5:userguide:transactions [2018/07/01 23:02] peterdd prefer functions start lowercase (#430) |
v5:userguide:transactions [2020/08/26 10:09] (current) dregad [Usage] Add braces as suggested by @peterdd in #629 |
||
---|---|---|---|
Line 46: | Line 46: | ||
$ok = $conn-> | $ok = $conn-> | ||
- | if ($ok) | + | if ($ok) { |
/* | /* | ||
* The previous execution succeeded, do some more | * The previous execution succeeded, do some more | ||
| | ||
$ok = $conn-> | $ok = $conn-> | ||
- | else | + | } else { |
/* | /* | ||
* Branch, do some other work, then return | * Branch, do some other work, then return | ||
*/ | */ | ||
- | if (!$ok) | + | } |
+ | |||
+ | if (!$ok) | ||
/* | /* | ||
* Test the last insertion, if not successful roll | * Test the last insertion, if not successful roll | ||
Line 61: | Line 63: | ||
*/ | */ | ||
$conn-> | $conn-> | ||
- | else | + | } else { |
/* | /* | ||
* Go ahead and commit | * Go ahead and commit | ||
*/ | */ | ||
$conn-> | $conn-> | ||
+ | } | ||
</ | </ | ||
----------------------------- | ----------------------------- |