naveed abbas naveed abbas - 4 months ago 9
HTML Question

php data between two dates for specific person

i retrieve data between two dates but the problem is to retrieve data between two dates for specific person so for i used this this is working perfectly when i only retrieve data between dates but did not work when i use dphone means for specific doctor phone number

$result = mysql_query("SELECT * FROM checker WHERE date between '$fromdate' AND '$todate' AND dphone='$splist'"


i want to retrieve data where dphone match any suggestion please so i can retrieve data according to my need

Answer

Try like this instead:

SELECT * FROM checker WHERE dphone='$splist' AND date BETWEEN '$fromdate' AND '$todate'

Also, are you sure the value in the "dphone" field for the doctor you're trying to get, matches $splist exactly?