I want to retrieve some data from a table where the age is in a certain range.
EXAMPLE
Persons with age from 20 to 30 years. How can I do it? I tried with the following query, but I was unable to get it.
$age="SELECT *
From rec_patient_reg
WHERE p_age >='$afrom' <= '$to'";
$result1=mysql_query($age)
or die(mysql_error());
while($result = mysql_fetch_array($result1)) {
echo "<b>Patient ID</b> = " .$result["Patient_id"] . " <br>";
echo "<b>NAME</b> = ".$result["p_fname"]."<br><br>----------------<br><br>";
Please help me.