Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beim Login kommt folgende Fehlermeldung #45

Open
Noam01 opened this issue Sep 3, 2022 · 1 comment
Open

beim Login kommt folgende Fehlermeldung #45

Noam01 opened this issue Sep 3, 2022 · 1 comment

Comments

@Noam01
Copy link

Noam01 commented Sep 3, 2022

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

@Noam01 Noam01 changed the title beim Login kommt golgende Fehlermeldung beim Login kommt folgende Fehlermeldung Sep 3, 2022
@Magnet-js
Copy link

Magnet-js commented Sep 4, 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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants