Insert Into Select and Value

Hi all,

I need help inserting data into a table:

$result = mysqli_query($mysqli, “INSERT INTO PD(ID, PDDate, PDOutcome) SELECT CareerID, ‘03/09/2019’, OFODetail FROM OFO”);

The date I’ve put in there as an “indicator” should come from the data entered in the HTML portion instead of the OFO table. So the date will be the same for all the rows.

Can anyone help with the syntax or method

Thanks

You have to set a placeholder and use bind_param before running execute, just follow the manual:

https://www.php.net/manual/en/mysqli.query.php

Thanks a lot. I will check it out

Sponsor our Newsletter | Privacy Policy | Terms of Service