I have selected the database but for some weird reason it still says that it is not selected.
Connection lines:
$location = \"localhost\"; $user = \"
Check if you have added the user to the db and gave him appropriate permissions.