I couldn't figure out this problem where I have multiple records from other tables, trying to transfer to another table.
So every time they press insert button, these records will be transferred but I do not know how to make them have the same reference id (Just a column for me to set all these records with the same id).
If they press again the insert button, the reference id will be different.
$input_comment = $_POST["comments"];
$sql3 = "INSERT INTO QuotationService
(referid, username, date, shiptype, city, country, poe, volume, volume2, service, included, price, comment)
SELECT username, date, shiptype, city, country, poe, volume, volume2, service, included, price, '$input_comment'
FROM ServiceHolds
WHERE username='$login_session' AND id=(SELECT MAX(id) FROM ServiceHolds)";
mysqli_query($conn, $sql3);
What should I do for my referid so that my conditions for what I said above will work?
This is a $_SERVER
request method.