This topic is locked
[SOLVED]

 delete a record from a different table

4/26/2011 3:57:54 PM
PHPRunner General questions
S
santonivich author

Good afternoon!
I am using a table as a "placeholder" for information. I am am using this table as a "lookup" table for my add page. Once a user has added a record, I would like to delete that record from my "placeholder" table.
For example lets say my table is called
MP3
In have a list of mp3's in the table with an assigned Id number. The user is able to go into the add page and select one of the mp3's in the dropdown list. Once they have added this specific mp3....I would like it to be removed from the "placeholder" table so that the mp3 is not listed the next time someone goes to the add page.
I realize I should use an AFTER_ADD_EVENT but I can't seem to get the correct query. Any idea's on how I can accomplish this?
Thank you.

Sergey Kornilov admin 4/26/2011

AfterAdd event is the proper place to put this code.
Try something like this:

CustomQuery("delete from MP3 where FieldName='".$values["LookupfieldName"]."'");