Please tell me there is a code that makes a copy of the fields in the table.
<?php $date = date("dmY G:i"); $servername = "localhost"; $database = "*"; $username = "*"; $password = "*"; $conn = mysqli_connect($servername, $username, $password, $database); mysqli_set_charset($conn, 'utf8'); $sql = "insert into order_products( name, price, id_products, amount, image) select name, price, id_products, amount, image from order_products where id_order=1"; mysqli_query($conn, $sql); $id = mysqli_insert_id($conn); mysqli_close($conn); header("Location: /"); ?> There is also an id_order column, in this field you need to write your value. Tell me how to do it. Thank.
select name, price, id_products, amount, image, 42 from ...? - u_mulder pm