P
P
Peter2015-06-16 12:43:28
symfony
Peter, 2015-06-16 12:43:28

Is it possible using $app[]->insert(...) to immediately get the entry id?

Hello
Inserting a record:
$app['db'] -> insert("foo", ['title' => 'bar']);
Surely there is some way to immediately get the id of the last record and not write another fetchAssoc?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Twist, 2015-06-16
@Alcospb

hi
, you should try
$app['db']->lastInsertId()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question