How to display image on condition that a selection has been made

you can try this:

if(get_field('activity_rating') == "1") { 
              echo 'path/to/image/onestar.jpg';
} elseif (get_field('activity_rating') == "2") {
              echo 'path/to/image/twostar.jpg';
} elseif (get_field('activity_rating') == "3") {
              echo 'path/to/image/threestar.jpg';
} elseif (get_field('activity_rating') == "4") {
              echo 'path/to/image/fourstar.jpg';
} else (get_field('activity_rating') == "5") {
              echo 'path/to/image/fivestar.jpg';
}

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