This topic is locked

Event when record deleted

6/1/2011 11:21:56 AM
PHPRunner General questions
U
unsearcheable author

Hello, can only set event in add or edit record.

If a user deletes a record, how can i set a event to update another record in another table ?
*EDIT
After using blessed Search button, found answer in http://www.asprunner.com/forums/topic/12158-before-record-deleted-all-id/ , but how can i use a field from the deleted record in event ?

C
chaintm 6/1/2011



Hello, can only set event in add or edit record.

If a user deletes a record, how can i set a event to update another record in another table ?
*EDIT
After using blessed Search button, found answer in http://www.asprunner.com/forums/topic/12158-before-record-deleted-all-id/ , but how can i use a field from the deleted record in event ?


well thats asp , you are in the php part of the forums, totally different things, if you want the php version...
**note build 5.2 info, you might be able to do the same in 5.3, however alot has changed, I try to help where I can. my guess is with a little bit of searching you can find things like the key value of a and rename that etc.. but the basics are here



if (@$_REQUEST["a"]=="delete")
$strUpdate = "Update YOURTABLENAMEHERE set YOURTABLEVALUE ='excampleonly'where YOURIDVALUEFORRECORD =".$_SESSION[$strTableName."_masterkey1"];

db_exec($strUpdate,$conn);


of course this all depends where your event is occuring, IE what page. list or edit. Most del functions are in listings thou so the above would be list before process.