This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:create:functions:dbset [24.01.2015 14:17] – [dbSet()] alexander.ritter | en:create:functions:dbset [16.11.2020 15:22] – [Example 2] admin | ||
---|---|---|---|
Line 31: | Line 31: | ||
===== Example 2 ===== | ===== Example 2 ===== | ||
- | The following PHP code checks | + | The following PHP code checks |
<code php> | <code php> | ||
Line 51: | Line 51: | ||
</ | </ | ||
- | The counter is incremented | + | The counter is incremented |
<code php> | <code php> | ||
- | // Counter increments one | + | // Counter increments |
- | if (isset($counted)) { | + | if (!isset($counted)) { |
$info = dbGet(reference()); | $info = dbGet(reference()); | ||
$info[1]++; | $info[1]++; | ||
dbSet(reference(), | dbSet(reference(), | ||
- | // Together with isset() it ensures it only counts | + | // Together with isset() it ensures it is counted |
$counted = true; | $counted = true; | ||
registerVariable(' | registerVariable(' | ||
Line 69: | Line 69: | ||
===== Example 3 ===== | ===== Example 3 ===== | ||
- | Perhaps | + | Perhaps the reference |
<code php> | <code php> | ||
dbSet(reference(), | dbSet(reference(), | ||
</ | </ |