Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82673

How to handle a SQL error response in Editor

$
0
0

Hello,

This is really not a problem but a how to question:

If I have a table that has a field that is a foreign key in another table, SQL responses properly with an error message stating that the row cannot be deleted when the user tries to delete the row in the Editor.

My question is how to best to handle the error in the Editor and tell the user that this row cannot be deleted. Right now it just shows the SQL error string in red at the bottom of the Editor popup.

This is the response that I would like to handle better:
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails ...

Thanks


Viewing all articles
Browse latest Browse all 82673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>