K
K
kiril90112018-06-28 19:44:49
PHP
kiril9011, 2018-06-28 19:44:49

How to display id?

Hello! there is a php insert handler adding information to the database, in MYSQL there is a primary key in id and so in this handler I perform copying, the approximate path is: site5/site10/$id
but $id is what appears after saving, the question is: how can I get it ? If you have questions, ask.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
glem1337, 2018-06-28
@kiril9011

Or php.net/manual/ru/function.mysql-insert-id.php
Or if you are using PDO, php.net/manual/ru/pdo.lastinsertid.php

S
Stanislav Pugachev, 2018-06-28
@Stqs

lmgtfy.com/?q=site%3Atoster.ru+%D0%BA%D0%B0%D0%BA+...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question