You need to use CONCAT
in order to merge day and month from your dob column and then compare using between clause
SELECT
*
FROM
personal
WHERE
CONCAT(EXTRACT(MONTH FROM dob),'-',EXTRACT(DAY FROM dob))
BETWEEN '$fromdate' AND '$todate'
Or better to use DATE_FORMAT
to get the month and day only but make sure you have standard date object stored in column, and the format you provide in DATE_FROMAT
must match with the format of your provided parameters
SELECT
*
FROM
personal
WHERE
DATE_FROMAT(dob,'%m-%d')
BETWEEN '$fromdate' AND '$todate'