You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beim Login kommt eine Fehlermeldung und man wird komischerweise auf die url http://localhost/shop/index.php/cart/add/3 geleitet, der Login an sich klappt aber. Und wenn es es Produkt mit der Id 3 gibt, dann wird das in den Warenkrob hintugefügt.
Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (test.cart, CONSTRAINT FK_cart_product FOREIGN KEY (product_id) REFERENCES products (id) ON DELETE SET NULL ON UPDATE CASCADE) in C:\xampp\htdocs\shop\function\cart.php:17 Stack trace: #0 C:\xampp\htdocs\shop\function\cart.php(17): PDOStatement->execute(Array) #1 C:\xampp\htdocs\shop\actions\cart\add.php(4): addProductToCart(1, 3) #2 C:\xampp\htdocs\shop\routes.php(220): require_once('C:\xampp\htdocs...') #3 C:\xampp\htdocs\shop\function\utilities.php(209): {closure}('cart', '/add', '3') #4 C:\xampp\htdocs\shop\routes.php(242): router('GET_/cart/add/3') #5 C:\xampp\htdocs\shop\includes.php(26): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\shop\index.php(13): require('C:\xampp\htdocs...') #7 {main} thrown in C:\xampp\htdocs\shop\function\cart.php on line 17
The text was updated successfully, but these errors were encountered:
Noam01
changed the title
beim Login kommt golgende Fehlermeldung
beim Login kommt folgende Fehlermeldung
Sep 3, 2022
Auf den ersten blick scheint es mir als würde es an deiner sql abfrage liegen .
Könntest du einmal die sql abfrage rein schicken damit ich diese mir mal anschauen kann ?
Beim Login kommt eine Fehlermeldung und man wird komischerweise auf die url http://localhost/shop/index.php/cart/add/3 geleitet, der Login an sich klappt aber. Und wenn es es Produkt mit der Id 3 gibt, dann wird das in den Warenkrob hintugefügt.
Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
test
.cart
, CONSTRAINTFK_cart_product
FOREIGN KEY (product_id
) REFERENCESproducts
(id
) ON DELETE SET NULL ON UPDATE CASCADE) in C:\xampp\htdocs\shop\function\cart.php:17 Stack trace: #0 C:\xampp\htdocs\shop\function\cart.php(17): PDOStatement->execute(Array) #1 C:\xampp\htdocs\shop\actions\cart\add.php(4): addProductToCart(1, 3) #2 C:\xampp\htdocs\shop\routes.php(220): require_once('C:\xampp\htdocs...') #3 C:\xampp\htdocs\shop\function\utilities.php(209): {closure}('cart', '/add', '3') #4 C:\xampp\htdocs\shop\routes.php(242): router('GET_/cart/add/3') #5 C:\xampp\htdocs\shop\includes.php(26): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\shop\index.php(13): require('C:\xampp\htdocs...') #7 {main} thrown in C:\xampp\htdocs\shop\function\cart.php on line 17The text was updated successfully, but these errors were encountered: