<?php
$res = mysql_query($qry) or die(mysql_error());
while($data = mysql_fetch_row($res))
{
echo "<option value=".$data[0].">" .$data[0]. "</option>";<br>
}
?>
In this case, supposing data[0] has sample data value then inside value only sample is storing. How to get whole value?
I’m calling this file by $.ajax method.
Your problem is that your value isn’t enclosed in quotes. You can fix this in two ways.
1:
2.
Just choose the one that fits you best.