AFAIU your question.
This answer by @velcrow calculates median value successfully. Unfortunately when there is even number of rows instead of calculating the mean value of 2 middle rows query just returns second value. I've made a couple of modifications to the query to fit your needs:
--average value for middle rows
SELECT avg(t1.price) as median_val FROM (
SELECT @rownum:=@rownum+1 as `row_number`, d.price
FROM mediana d, (SELECT @rownum:=0) r
WHERE 1
-- put some where clause here
ORDER BY d.price
) as t1,
(
SELECT count(*) as total_rows
FROM mediana d
WHERE 1
-- put same where clause here
) as t2
WHERE 1
--this condition should return one record for odd number of rows and 2 middle records for even.
AND t1.row_number>=total_rows/2 and t1.row_number<=total_rows/2+1;
Test on sample data on sqlfiddle