This topic is locked

delete table event

7/4/2006 10:19:11 AM
PHPRunner General questions
coolbyte author

I looking for a method to create a delete table event, which is called before and after deleting an entry. How can I emulate this by modifying the generated code?

Alexey admin 7/5/2006

Hi,
PHPRunner-created pages don't delete tables so no event is possible.

Please clarify your task.

coolbyte author 7/5/2006

Hi,

PHPRunner-created pages don't delete tables so no event is possible.

Please clarify your task.


I want to call two functions when an entry is deleted, one before and one after the delete is performed. The functions need the id of the deleted entry. How can I modify the generated code to call the functions.

Alexey admin 7/5/2006

Hi,
use $where argument of BeforeDelete event for this.

Select the record being deleted and get it's key field value.
Here is the sample code:

global $conn;

$rs=db_query("select * from mytable where ".$where,$conn);

$data=db_fetch_array($rs);
$key = $data["ID"];