This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:functions:dbset [24.01.2015 14:14] – [dbSet()] alexander.ritter | en:create:functions:dbset [24.01.2015 14:29] – [Example 2] alexander.ritter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== dbSet() ====== | ====== dbSet() ====== | ||
- | Data can be written into the **Database for Contents** during the survey with '' | + | Data can be written into the **Database for Contents** during the survey with '' |
An entry can also be deleted from the database with this function. | An entry can also be deleted from the database with this function. | ||
Line 12: | Line 12: | ||
* '' | * '' | ||
* < | * < | ||
- | * < | + | * < |
**Note:** Each entry in the database has a timestamp with the date and time of the most recent change. By updating with '' | **Note:** Each entry in the database has a timestamp with the date and time of the most recent change. By updating with '' | ||
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(' |