K
K
Knyashshsh2018-04-07 16:11:34
PHP
Knyashshsh, 2018-04-07 16:11:34

How to get newly loaded row in db?

In from, I have a product editing page in the admin panel site.ru/product-page.php?id=2, where the id value is the id in the database.
I have a page for adding a product, and here's how to redirect the user to the page of this post after that?
There is an option to extract the largest ID and ++ from the database, but this product could be deleted and what to do in this case heze.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-04-07
@fyapy

us1.php.net/manual/ru/pdo.lastinsertid.php
php.net/manual/ru/mysqli.insert-id.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question