如何使用php比较mysql中的浮点值

 SELECT `UM`.`usermaster_id`, `UM`.`height`, `UM`.`income_range`, 
`UM`.`surname`, `UM`.`display_name`, `UM`.`about_me`, `UM`.`profile_id`, 
`UM`.`marital_status`, `UM`.`birth_date`, `UM`.`age`, `UM`.`gender`, 
`UM`.`mother_tongue_id`, `UM`.`religion_id`, `UM`.`cast_id`, 
`UM`.`sub_cast_id`, `UM`.`highest_degree`, `UM`.`occupation`, `UM`.`city_id`,
TIMESTAMPDIFF(YEAR, `birth_date`, CURDATE()) as newage FROM (`user_master` 
UM) WHERE ( UM.height >= 5.7 AND UM.height <= 5.11 AND UM.income_range 
IN(4,7,5,8,9,10) AND UM.cast_id IN(3,15,7) AND UM.marital_status IN('Never 
Married') ) AND `UM`.`gender` = 'Male' AND `UM`.`active` = 1 HAVING `newage`
BETWEEN 31 AND 34

height column value display record not found.

can you just remove the UM since you are only referencing to just one table only?

It seems, you have missed a closing parenthesis :

<?php
//connect to the database
$conn = myslqi_connect("localhost", "root", "", "db_test") or trigger_error(mysqli_error($conn));
//prepare the statement
$sql = "SELECT UM.usermaster_id, UM.height, UM.income_range, UM.surname, M.display_name,UM.about_me,UM.profile_id,UM.marital_status,UM.birth_date, UM.age, UM.gender, UM.mother_tongue_id, UM.religion_id, UM.cast_id, UM.sub_cast_id, UM.highest_degree, UM.occupation, UM.city_id, TIMESTAMPDIFF(YEAR, birth_date, CURDATE()) as newage 
    FROM (user_master UM) 
    WHERE ( UM.height >= 5.7 AND UM.height <= 5.11) 
    AND UM.income_range IN(4,7,5,8,9,10) 
    AND UM.cast_id IN(3,15,7) 
    AND UM.marital_status ='Never Married'
    AND UM.gender = 'Male' 
    AND UM.active = 1 
    HAVING newage BETWEEN 31 AND 34";
//execute the sql
$res = mysqli_query($conn, $sql) or or trigger_error(mysqli_error($conn));
//declare a blank array
$data = array();
//verify if there are records
if(mysqli_num_rows($res) > 0){
//there are records
//loop through the records and store it in the array
while($row = mysqli_fetch_assoc($res)){
array_push($data, $row);//push the contents
}//loop ends
}//if ends

//at this point either the array has data or do not have any records
echo '<pre>';
print_r($data);
echo '</pre>';

?>

Rest you can do anything what you like to do with the records. As per your question, comparing floating values now do you need these records to be sorted on the basis of height?