How can I require/include the database to fetch dropdown values from database

Can you expand on “but it does not work”? Does it give you an error message, in which case what does it say? Or does it just not do anything? I am no OOP expert but I believe you’ll also have to change your calling code to use the database class that you define in there, so can you also show the changes you made there?

Fatal error: Cannot redeclare class Database in C:\xampp\htdocs\media\database\database.php on line 3

It gives this message

you included/required the class twice. don’t do that. by default the error message should contain both declaration files, so you can skip one of them.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.