File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
user_guide_src/source/database Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -954,18 +954,26 @@ $builder->upsertBatch()
954954
955955.. versionadded :: 4.3.0
956956
957+ Upsert from Data
958+ ^^^^^^^^^^^^^^^^
959+
957960Generates an upsert string based on the data you supply, and runs the
958961query. You can either pass an **array ** or an **object ** to the
959962method. By default a constraint will be defined in order. A primary
960963key will be selected first and then unique keys. MySQL will use any
961- constraint by default. Here is an example using an array:
964+ constraint by default.
965+
966+ Here is an example using an array:
962967
963968.. literalinclude :: query_builder/108.php
964969
965970The first parameter is an associative array of values.
966971
967972.. note :: All values are escaped automatically producing safer queries.
968973
974+ Upsert from a Query
975+ ^^^^^^^^^^^^^^^^^^^
976+
969977You can also upsert from a query:
970978
971979.. literalinclude :: query_builder/115.php
You can’t perform that action at this time.
0 commit comments