将字符串转换为日期并在mysql中使用别名

I have searched the forum for the appropriate code or if there is any solution but none yet. I have in my database this varchar 12-03-1994 (d-m-Y) and my code selects the number of users in that age range. I needed to convert the date_of_birth which is in varchar to date_format and I used str_to_date so I did this but kip getting an empty result. what am I doing wrong?

$aged = $conn->prepare("SELECT COUNT(STR_TO_DATE('date_of_birth','%d-%m-%Y')) as year FROM tbl_members WHERE date_of_birth BETWEEN CURDATE() - INTERVAL 105 YEAR AND 
    CURDATE() - INTERVAL 36 YEAR AND resultselect = ?");
$aged->execute(array($pid));
$recordaged = $aged->fetchObject();
$recorda = $recordaged->year;

Ok, I don't have anything for testing this on, but it looks like it works...

// needs variables $conn and $pid
$aged = $conn->prepare("SELECT STR_TO_DATE('date_of_birth','%d-%m-%Y') as converted_date FROM tbl_members WHERE converted_date BETWEEN CURDATE() - INTERVAL 105 YEAR AND CURDATE() - INTERVAL 36 YEAR AND resultselect = ?");
$result = $aged->execute(array($pid));
$count = mysql_num_rows($result);