Wouldn't be better to make use of validators [1]? This way you can assure
that all foreign key constrains are fulfilled
[1] http://www.symfony-project.com/book/trunk/10-Forms#Form%20Validation
Cheers,
Marc
2007/8/1, Michael Smith <[EMAIL PROTECTED]>:
>
>
> You have to pares the exception mess
You have to pares the exception message to determine if it was a
foreign key and which one it was. I wish there was a cleaner way of
doing it but the function below works for mysql at least.
/**
* Parses out the table, field, and error message from a foreign key
failure