I am attempting to delete a row in two dependent tables based on a third tables ID.
Table structure:
Transaction -Transaction_ID (primary) -Timestamp Purchase -Item_ID -Transaction_ID -Purchase_ID (primary) Item -Item_ID (primary) -Client_ID
The fact is that I Can't delete from a table as long as dependent records still exist in another table. so as the dependency goes like this
Transaction <- Purchase -> Item
How can I delete any purchases first before I can delete transactions. if I want to delete a Transaction in flexigrid?
or
How can I delete any Item first before I can delete transactions. if I want to delete an Item in flexigrid?
I would also like ( if I try to delete either of them) to show a message and tell that there is a relation Purchase that have to be deleted before deleting either Transaction or Item?
Is a call_back the way to go or how=?