You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code will update the table `test` and set the fields `fld1`, `fld2`, and `fld3` to `A`, `B`, and `C` respectively where the `fld1` is greater than 10.
45
+
This code will update the table `test` and set the fields `fld1`, `fld2`, and `fld3` to `A`, `B`, and `C`
46
+
respectively for all records where `fld1` is greater than 10.
47
+
48
+
## Insert records with InsertQuery
49
+
50
+
You can insert records using the `InsertQuery` object. See an example:
51
+
52
+
```php
53
+
<?php
54
+
$insertQuery = new \ByJG\MicroOrm\InsertQuery();
55
+
$insertQuery->table('test');
56
+
$insertQuery->set('fld1', 'A');
57
+
$insertQuery->set('fld2', 'B');
58
+
$insertQuery->set('fld3', 'C');
59
+
```
60
+
61
+
## Insert records from another select
62
+
63
+
You can insert records from another select using the `InsertSelectQuery` object. See an example:
64
+
65
+
```php
66
+
<?php
67
+
68
+
// Define the query to select the records
69
+
$query = new QueryBasic();
70
+
$query->table('table2');
71
+
$query->field('fldA');
72
+
$query->field('fldB');
73
+
$query->field('fldC');
74
+
$query->where('fldA = :valueA', ['valueA' => 1]);
75
+
76
+
// Define the insert select query
77
+
$insertSelectQuery = new \ByJG\MicroOrm\InsertSelectQuery();
0 commit comments