ADOdb: Replace DataTag: adodb, database, database layer Category: PHP Databasepost: 31 Oct 2007 read: 1,911 Try to update a record, and if the record is not found, an insert statement is generated and executed. Returns 0 on failure, 1 if update statement worked, 2 if no record was found and the insert was executed successfully. This differs from MySQL's replace which deletes the record and inserts a new record. This also means you cannot update the primary key. The only exception to this is Interbase and its derivitives, which uses delete and insert because of some Interbase API limitations. Formula:
The parameters are $table which is the table name, the $keyCols which is an associative array where the keys are the field names, and keyCols is the name of the primary key, or an array of field names if it is a compound key. If $autoQuote is set to true, then Replace() will quote all values that are non-numeric; auto-quoting will not quote nulls. Note that auto-quoting will not work if you use SQL functions or operators.
|
| | Give Your Opinion | Recommend |
|

