D
D
Denis Sokolov2021-06-17 11:35:24
SQL
Denis Sokolov, 2021-06-17 11:35:24

How to get an ID?

How to get the ID of the element I just entered into the table

INSERT INTO service.ads(ad_name, ad_creator, ad_price, ad_category, ad_youtube, ad_description, ad_place, ad_telephone, ad_way_communication)
            VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-06-17
@Rsa97

Depends on the SQL dialect and the client being used.
MySQL - LAST_INSERT_ID()
PHP - mysqli::$insert_id and PDO::lastInsertId

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question