I am trying to use $dbc->connect_error
to check if any error occurs while trying to connect to my databease. I always get an error page saying:
If we have a look at the PDO manual and look up for the PDO class there is no connect_error
property anywhere. But if we check mysqli manual we see it right there. You have to choose a database library and stick to it, they cannot be mixed.
I always recommend to configure PDO to throw exceptions as you already do (although connection errors in particular will always through an exception no matter your settings) and not care to catch them unless you want to do something specific with them.