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:databank [24.01.2015 14:08] – [Database for Contents] alexander.ritter | en:create:databank [26.11.2020 20:59] – [Example 4: Relay A Priori Data] sophia.schauer | ||
---|---|---|---|
Line 40: | Line 40: | ||
===== Import Data ===== | ===== Import Data ===== | ||
- | First of all, the data has to be stored in a table, e.g. in excel or Open Office | + | First of all, the data has to be stored in a table, e.g. in excel or Open Office |
* the first column must contain the key | * the first column must contain the key | ||
* the other columns contain the data | * the other columns contain the data | ||
Line 199: | Line 199: | ||
// now show the question | // now show the question | ||
question(' | question(' | ||
+ | </ | ||
+ | |||
+ | ===== Example 5: Complete Data ===== | ||
+ | |||
+ | To add an entry to the database for content during the interview, it must be read out, added and then written again. | ||
+ | |||
+ | For example, under the key " | ||
+ | |||
+ | <code php> | ||
+ | $key = ' | ||
+ | // Reading data | ||
+ | $data = dbGet($key); | ||
+ | if ($data === false) { | ||
+ | // No data found - maybe show warning | ||
+ | $data = array(-8, -8, -8); // ... and initialize the data element | ||
+ | } | ||
+ | // Add the answer from PP01 | ||
+ | $data[3] = value(' | ||
+ | // save entry again | ||
+ | $data = dbSet($key, $data); | ||
</ | </ |