I need help on some update like function:
<html>
$result = mysql_query("SELECT *FROM tbl_a LEFT JOIN tbl_b lass ON tbl_b.b_id=a.class_id LEFT JOIN category ON category.category_id=tbl_a.category_id WHERE list ='{$id}'"); </br>
while($row = mysql_fetch_array($result)){
$id_list = $row['id'];
$name = $row['name'];
....
}
}
echo "<script type='text/javascript'>
var id = document.getElementById('list').value = '.$id_list;'
var name = document.getElementById('fname').value ='.$name;'
</script> ";
</html>
my problem is that i can retrieve data but it not displaying on my input elements it should be like an update function