|
87 | 87 | <li><a href="#db-table">table()</a></li> |
88 | 88 | <li><a href="#db-truncate">truncate()</a></li> |
89 | 89 | <li><a href="#db-update">update()</a></li> |
| 90 | + <li><a href="#db-upsert">upsert()</a></li> |
90 | 91 | <li><a href="#db-value">value()</a></li> |
91 | 92 | <li><a href="#db-where">where()</a></li> |
92 | 93 | </ul> |
@@ -155,7 +156,7 @@ <h3 class="h4" id="db-having">having(string $value=null)</h3> |
155 | 156 | </section> |
156 | 157 | <section> |
157 | 158 | <h3 class="h4" id="db-insert">insert(array $data, $modifiers=null)</h3> |
158 | | - <p>Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>, |
| 159 | + <p>Insert record in the database. Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>, |
159 | 160 | <code>HIGH_PRIORITY</code>, <code>IGNORE</code></p> |
160 | 161 | <pre class="prettyprint">$db->insert(['name'=>'John']); |
161 | 162 | $db->insert(['name'=>'John'], 'IGNORE');</pre> |
@@ -221,6 +222,13 @@ <h3 class="h4" id="db-update">update(array $data, $modifiers=null)</h3> |
221 | 222 | <p>Update records in the database. Available modifiers are: <code>LOW_PRIORITY</code>, <code>IGNORE</code></p> |
222 | 223 | <pre class="prettyprint">$db->update(['name'=>'Peter']); |
223 | 224 | $db->update(['name'=>'Peter'], 'IGNORE');</pre> |
| 225 | + </section> |
| 226 | + <section> |
| 227 | + <h3 class="h4" id="db-upsert">upsert(array $data, $modifiers=null)</h3> |
| 228 | + <p>Insert new records or update the existing ones. Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>, |
| 229 | + <code>HIGH_PRIORITY</code>, <code>IGNORE</code></p> |
| 230 | + <pre class="prettyprint">$db->upsert(['email'=>'peter@gmail.com','name'=>'Peter Schmidt']); |
| 231 | +$db->upsert(['email'=>'peter@gmail.com','name'=>'Peter Schmidt'], 'LOW_PRIORITY');</pre> |
224 | 232 | </section> |
225 | 233 | <section> |
226 | 234 | <h3 class="h4" id="db-value">value(string $column)</h3> |
|
0 commit comments