UPDATE, or by using unique indexes in combination with INSERT IGNORE.
Then use the affected row count to see if the query succeeded.
+------------------------------------------------------------------------
+ Supported DBMSs
+------------------------------------------------------------------------
+
+MediaWiki is written primarily for use with MySQL. Queries are optimized
+for it and its schema is considered the canonical version. However,
+MediaWiki does support the following other DBMSs to varying degrees.
+
+* PostgreSQL
+* SQLite
+* Oracle
+* IBM DB2
+* MSSQL
+
+More information can be found about each of these databases (known issues,
+level of support, extra configuration) in the "databases" subdirectory in
+this folder.
--- /dev/null
+== See also ==
+*[http://www.mediawiki.org/wiki/Manual:IBM_DB2 Installation instructions]
+*[http://ca.php.net/manual/en/function.db2-connect.php PHP Manual for DB2 functions]
\ No newline at end of file
--- /dev/null
+SQLite shares the MySQL schema file at maintenance/tables.sql, with a set of
+compatibility regexes to convert MySQL syntax to SQLite syntax:
+
+* BINARY() and VARBINARY() fields are converted to BLOB
+* the UNSIGNED modifier is removed
+* "INT" fields are converted to "INTEGER"
+* ENUM is converted to BLOB
+* the BINARY collation modifier is removed
+* AUTO_INCREMENT is converted to AUTOINCREMENT
+* Any table options are removed
+* Truncated indexes are upgraded to full-width indexes
+* FULLTEXT indexes are converted to ordinary indexes
+++ /dev/null
-== See also ==
-*[http://www.mediawiki.org/wiki/Manual:IBM_DB2 Installation instructions]
-*[http://ca.php.net/manual/en/function.db2-connect.php PHP Manual for DB2 functions]
\ No newline at end of file
+++ /dev/null
-SQLite shares the MySQL schema file at maintenance/tables.sql, with a set of
-compatibility regexes to convert MySQL syntax to SQLite syntax:
-
-* BINARY() and VARBINARY() fields are converted to BLOB
-* the UNSIGNED modifier is removed
-* "INT" fields are converted to "INTEGER"
-* ENUM is converted to BLOB
-* the BINARY collation modifier is removed
-* AUTO_INCREMENT is converted to AUTOINCREMENT
-* Any table options are removed
-* Truncated indexes are upgraded to full-width indexes
-* FULLTEXT indexes are converted to ordinary indexes