I am using ajax and returning values by the following method
$query = mysql_query("SELECT DISTINCT * FROM symptom WHERE symptom LIKE '%$key%'")or die('couldnt select');
while(($row = mysql_fetch_array($query))!=false){
echo $row['disease'];
}
but the result received in ajax function shows the result like
streppneumonia
instead of
strep
pneumonia
What am i doing wrong?I just can’t figure out the problem here.
when using ajax and returning multiple values, send it in the json format. You cannot distinguish the multiple values although you can break with break tag on the client side:
Later, decode by js on the client side