hello - i need your help i have following script in before record added which it select some records and insert to other table / actually i would like to get all records from tblordersupplydetails where enqury link = description and insert all values to table proformachilditems.
My script below it only insert 1 record from tblordersupplydetails to proforormachilditems altough they can be 3-4 or more records - can someone help me ? thanks
quote
$strSQLSELECT = "SELECT * FROM tblordersupplydetails WHERE EnquryLink='".$values['description']."'";
$rs = db_query($strSQLSELECT,$conn);
$data = db_fetch_array($rs);
$strSQLInsert1 = "insert into proformachilditems (Description, ShortCode, UnitLink, Quantity, Curr)
values ('".$data['Description']."','".$data['ShortCode']."','".$data['UnitLink']."','".$data['Quantity']."'
,'".$data['Curr']."') " ;
CustomQuery($strSQLInsert1);
// Place event code here.
// Use "Add Action" button to add code snippets.
return true;
unquote
My script below it only insert 1 record from tblordersupplydetails to proforormachilditems altough they can be 3-4 or more records - can someone help me ? thanks
quote
$strSQLSELECT = "SELECT * FROM tblordersupplydetails WHERE EnquryLink='".$values['description']."'";
$rs = db_query($strSQLSELECT,$conn);
$data = db_fetch_array($rs);
$strSQLInsert1 = "insert into proformachilditems (Description, ShortCode, UnitLink, Quantity, Curr)
values ('".$data['Description']."','".$data['ShortCode']."','".$data['UnitLink']."','".$data['Quantity']."'
,'".$data['Curr']."') " ;
CustomQuery($strSQLInsert1);
// Place event code here.
// Use "Add Action" button to add code snippets.
return true;
unquote