If used multiple timesmouldInsert The ID that may be retrieved may be the last ID.
as if
model->save(
d
a
t
a
)
;
take over for sb.
following
(prefix indicating ordinal number, e.g. first, number two etc)
second
the second (day, time etc)
m
o
d
e
l
-
>
s
a
v
e
(
data); then the second model->save(
data);take over for sb.(chess) move(prefix indicating ordinal number, e.g. first, number two etc)stupid (Beijing dialect)substandardmodel−>save(data)
The id retrieved may be the id of the first insert, in which case use InsertgetID to retrieve the id.
If you use insertAll, use getLastInsID to get the initial ID value and then use a for loop to get the id.arrays
for ($i=0; $i<count($data); $i++) {
array_push($getIdArr,$getId);
$getId=$getId+1;
}
- 1
- 2
- 3
- 4