Function savetodb
In short: savetodb(table, column, value) —
It's a way of telling the database, "Here's the data, put it here, please!"
How it works in practice:
a table is not just a "table", but the result of calling opentable. That is, the table that you are already working with.
column — the name of the column (as a row) or its index (from scratch, yes, thanks, programmers). The main thing is that it really exists.
value is what you want to write there. But not everything is so simple — if the database is external (for example, MySQL), then data types come into play. Line to line, number to number. Otherwise, swearing, mistakes, and no recording.
What savetodb does:
Finds out if there is such a column in the table at all. No — dosvidos, there will be a mistake, it will not save anything.
Checks — and what line are you standing on now? Does it exist at all? If the pointer went past all the lines into the sunset, I'm sorry, it went by.
Checks: Are you adding line to line? Number to number? Or did you bring an apple to the brick department again? If the types don't match, see the swearing section above.
If everything is normal, it puts your data in the appropriate column of the current row. Quiet, calm, like a human being.
Important: savetodb changes the data in the "memory". If you want the changes to go to the database, call updatedb. Without this, all your diligent input will remain local and will not be saved anywhere.
And yes, savetodb doesn't do magic. It just writes the value to where you specified it. But he does it with verification and according to the rules. The curved data is missing. Correct ones, please write them down.
Help on built-in functions
The rules of programming scripts
Programm options
Color constants