I don’t know why you’re using global variables in the first place, for you’re using a configuration file (config.php) for all you would have to do is something like -
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected’ in C:\wamp\www\rehber\kaydet.php on line 15
( ! ) PDOException: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected in C:\wamp\www\rehber\kaydet.php on line 15
I don’t think that’s how you are suppose to use the prepared statements. As far as I know it, the only library that uses question marks as placeholders is the MySQLi_ library (I could be wrong).
That could be the reason why your first error you are having is throwing you Fatal error: Call to a member function prepare() on a non-object in. It could also be a typo or mis-spelled field. Usually this is the case. That or the field doesn’t exist.