N
Every php user, not even a software player, should make a habit of reading error reports. And it's important to read the whole thing, not just the first few words.Usually, the erroneous report details what the problem is.For example, in this case, we're writing that the user is trying to copy with the name DATABASE_USERNAME, which looks quite unusual, and more like the name. Constantsthan in the name of the database.We're looking at the code and we're convinced that, yes, the constant is taken for some reason, and in the end, it's not its meaning, it's literally the line DATABASE_USERNAME. If you remove the skirts, the connection to the PDO will be successful.To use the constants in the DSN line, the content should be:$dsn = 'mysql:dbname='.DATABASE_NAME.';host='.DATABASE_HOST
Again, I recall the need to record the correct and relevant values in the above-mentioned constants.