jtigue Posted April 14, 2015 Share Posted April 14, 2015 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. Link to comment Share on other sites More sharing options...
Larry Posted April 15, 2015 Share Posted April 15, 2015 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. Link to comment Share on other sites More sharing options...
jtigue Posted April 15, 2015 Author Share Posted April 15, 2015 Thank you for responding. I have fixed it. Link to comment Share on other sites More sharing options...
Recommended Posts