This topic is locked
[SOLVED]

 before delete a record to delete records values of one other table

9/6/2019 9:14:23 AM
PHPRunner General questions
C
chrispa author

hi,
what i need is - when i select to delete some records from one table lets say table1 a script to check values of a table2 and if table1.connect1 = table2.connect2 then delete all these values from table2.
https://xlinesoft.com/phprunner/docs/before_deleting_a_record_check_if_related_records_exist.htm
i have seen that but not sure how to complete the queries .
thanks

C
chrispa author 9/6/2019

found it - it was so easy
global $dal;

$tblOrder = $dal->Table("proformachilditems");

$rs = $tblOrder->Query("connect=".$deleted_values["description"],"");

$data = db_fetch_array($rs);

if($data)

$sql6 = "delete proformachilditems

from proformachilditems

where description = '".$data['connect']."'";
CustomQuery($sql6);

return true;