Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`glot6658_invoice_db`.`payments`, CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`)) in /home/glot6658/public_html/invoice-app/app/models/Invoice.php:78 Stack trace: #0 /home/glot6658/public_html/invoice-app/app/models/Invoice.php(78): PDOStatement->execute(Array) #1 /home/glot6658/public_html/invoice-app/app/controllers/InvoiceController.php(372): Invoice->delete(7) #2 /home/glot6658/public_html/invoice-app/public/index.php(21): require('/home/glot6658/...') #3 {main} thrown in /home/glot6658/public_html/invoice-app/app/models/Invoice.php on line 78