I
I
Igorek982021-05-10 22:21:24
SQL
Igorek98, 2021-05-10 22:21:24

Is it possible to find out the id of the added product without making a second request after adding it?

Tell me, how do you usually add images?
As I understand it, in a separate table for the product ID, but how do we get this ID?
Will I have to make a second request to the product right away, or can I get an ID when adding it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-05-10
@Igorek98

It depends.
For example, PHP has PDO::lastInsertId and mysqli::$insert_id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question