I am writing a PHP application in which a user can select an item from a list for deletion, but I want to check the constraints BEFORE even attempting the delete. Then I can potentially highlight these items ahead of time alerting the user of the constraint. I could make a programatic list of all of the constraints and do the checks through PHP, but what if down the line, other constraints are added on the database side? I would then need to define these new constraints in the program.

Basically, is there a constraint check query that can be run without actually trying the delete and catching the error?