Query alone is working as expected. check this SQLFiddle: http://sqlfiddle.com/#!2/e262d/1
however seems to be the following line has some issue. try this corrected one:
$query = $this->db->prepare("SELECT id, name FROM users WHERE MD5(id) = '$enc'");
note: I have removed the wrong quote character present in your code surrounding users and id.