Update master table from detail not working

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
inilcavalery
User
Posts: 51

Update master table from detail not working

Post by inilcavalery »

Hi all...

I'm trying to update master table from detail table but not working, here is my row_updated server event code
function Row_Updated($rsold, &$rsnew) {
global $conn;
$status = $rsnew["status"];
$p_id = $rsnew["prospect_id"];
$sUpdateSql = "UPDATE prospect SET status = "."'".$status."'"." WHERE prospect_id=" .'"'.$p_id.'"';
$conn->Execute($sUpdateSql);
}

the funny thing is the code above is working when i put it in row_inserted event.
the point is i need both row_inserted and row_updated events, since i need to monitor the last status from master table but the data itself is updated from detail table.
Anyone ever have this kind of problem?

Thanks


inilcavalery
User
Posts: 51

Post by inilcavalery »

Solved, use $rsold for row_update event instead $rsnew


Post Reply