Contents

 
Home
PHPRunner 6.1 manual
Prev Page Next Page
 
 

Before deleting a record check for related records

 

Before deleting a record in the Orders table check for related items in the OrderDetails table. Add the following code to the List page: Before record deleted event.

yellowbulbNote: Change the values listed in red to match your specific needs.

// Parameters:

// where - string with WHERE clause pointing to record to be deleted.

global $dal;

$tblOrder $dal->Table("OrderDetails");

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

$data = db_fetch_array($rs);

if($data)

  return false;

else

  return true;

For more information about using Data Access Layer (DAL), see Data Access Layer.

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)