i'm using this code for post text of option tag :
$("#major_names").change(function () {
$.post('find_lesson.php', { dars:$("#major_names option:selected").text() },
function(data){
if (data.success)
$("div").append(data.doroos);
else
alert('mm');
},'json');
return false;
});
now in find_lesson file i use this code for fetch any record from database
<?php
$lessonName=$_POST['lesson '];
$query= mysql_query("SELECT * FROM at_*** WHERE title = '{$lessonName}'");
$result= mysql_fetch_array($query);
$sql= mysql_query("SELECT * FROM *** JOIN at_lessons ON . . .");
while($result=mysql_fetch_assoc($sql))
{
$data ['doroos']= $result['title'];
}
$data['success']=true;
echo json_encode($data);
?>
mysql command is correct but after send array i have getting 1 record. please help me