DatabaseUpdate()
Syntax
Result = DatabaseUpdate(Request$)Description
Executes the SQL 'Request$' on the current database. This command is similar to DatabaseQuery() but doesn't affect the NextDatabaseRow() command, which means it's not possible to do a 'SELECT' like request with this command. This command is very handy when something has to be changed in the database for each record. If the 'Result' is 0, then the query can't be executed correcty (SQL fault, bad formatted query, etc.. The error text can be retreived with DatabaseError()).
Example; First, connect to a database with an employee table ; If DatabaseQuery("SELECT * FROM employee") ; Get all the records in the 'employee' table While NextDatabaseRow() ; Loop for each records ; Update the 'checked' field for each records, assuming the 'id' field is ; the first one in the 'employee' table ; DatabaseUpdate("UPDATE employee SET checked=1 WHERE id="+GetDatabaseString(0)) Wend EndIf
Supported OS
Windows, Linux, MacOS X