This topic is locked

insert into a table values from another table

5/11/2018 6:54:22 PM
PHPRunner General questions
P
PaulM author

I'm trying to insert the values from a lookup table into another table with the 'After record added' event and also add the id of the record I've just added. I've tried this but it doesn't work, any help would be much appreciated.
$sql = "INSERT INTO Certificates (PC_P_id,PC_type,PC_valid_For_weeks,PC_status) values ('".$values[P_id]."',(select CV_type,CV_duration_weeks from Certificate_Values where CV_table='Certificates'),'Pending',)";

CustomQuery($sql);

F
firecloud 5/11/2018



I'm trying to insert the values from a lookup table into another table with the 'After record added' event and also add the id of the record I've just added. I've tried this but it doesn't work, any help would be much appreciated.
$sql = "INSERT INTO Certificates (PC_P_id,PC_type,PC_valid_For_weeks,PC_status) values ('".$values[P_id]."',(select CV_type,CV_duration_weeks from Certificate_Values where CV_table='Certificates'),'Pending',)";

CustomQuery($sql);



try activate debug=true in appsettings.php for better picture.

admin 5/12/2018

Instead of executing this query print it on the page to see what might be wrong with it.