Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have created a website using PHP, connected to a database but I am getting err

ID: 3709770 • Letter: I

Question

I have created a website using PHP, connected to a database but I am getting errors on my home page and my cart. I have checked files for duplicates. Here is the error:

( ! ) Notice: Constant DB_SERVER already defined in C:wampwwwincludesdbconnect.php on line 10

Call Stack

#             Time      Memory              Function              Location

1              0.0022   132784 {main}( )               ...index.php:0

2              0.0123   199096 require( 'C:wampwwwpageshome.php' )       ...index.php:48

3              0.0123   199120 getAllBooks( )    ...home.php:1

4              0.0191   199440 DB->get( )           ... unctions.php:6

5              0.0191   199520 DB->connect( ) ...dbconnect.php:27

6              0.0191   199664 define ( )              ...dbconnect.php:10

Explanation / Answer

The error means, You are included dbconnect.php twice in two files.. so that you are getting that error...

Whatever the page is loaded, please check included pages whether how many times that you included dbconnect.php.

You can use require_once() instead of require() to prevent this.

If you still have any doubts, please give me comment...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote