Posts by Mauricio Santana • 23 points
1 post
-
2
votes1
answer10272
viewsQ: How to fix "1452 > a Foreign key Constraint fails" error using PDO in PHP?
First I know what is the mistake of Foreign key, however I do not know why it is happening in PHP code with PDO. Insertion function: function insert_pedido($cod,$pagamento,$total){ (int)$id = $cod;…