Skip to content
Advertisement

Fatal error: Uncaught Error: Call to a member function query() on null in C:xampphtdocsshopindex.php

I have a problem with my code I’m getting this error message

Fatal error: Uncaught Error: Call to a member function query() on null in C:xampphtdocsshopindex.php:11 Stack trace: #0 {main} thrown in C:xampphtdocsshopindex.php on line 11

index.php

JavaScript

./function/database.php

JavaScript

Advertisement

Answer

You forgot to create PDO connection:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement