Jump to content
Larry Ullman's Book Forums

Recommended Posts

I am trying to create a form that includes two drop-down select menus that each display records from their respective table from a database.  Each drop-down menu uses the require statement to call my mysqli_connect script as does the overall form when it is called to insert the records, making 3 total require statements.

 

When I tested the page it worked on the testing server but now I receive Constant DB_NAME, DB_HOST, DB_PASSWORD, and DB_USER already defined errors now that the site is live.

 

I have tried using require_once on one, two , or all three calls instead of require but then one of my drop-down menus stops working and seem to get the same message.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

You should definitely rewrite the code so that it only creates one database connection. There's absolutely no reason why a drop-down menu should use a require statement like this. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...