Looking for the code in twentyten that allows users to select images for the header/banner

The code you are looking for is in functions.php (line 106 to 211).

To understand what they have done in TwentyTen, I would suggest that you read the following:

http://codex.wordpress.org/Function_Reference/add_custom_image_header

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)