index.php
<html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
$("#test").change(function(){
var val = 'name=' + $(this).val();
$.ajax({
type : "POST",
url : "test.php",
data : val,
dataType : "json",
success : function(even){
$("#load").val(even.nama_lengkap);
$("#jur").val(even.jurusan);
$("#password").val(even.password);
}
});
});
});
</script>
</head>
<body>
<input type="text" id="test">
<input type="text" id="load">
<input type="text" id="jur">
<input type="text" id="password">
</body>
</html>
test.php
<?php
mysql_connect('localhost','root','');
mysql_select_db('sisfo');
$name = $_POST['name'];
$sql = mysql_query("SELECT * FROM mahasiswa_data WHERE nim='$name'");
$row = mysql_fetch_assoc($sql);
$data['nama_lengkap'] = $row['nama_lengkap'];
$data['jurusan'] = $row['jur'];
$data['password'] = $row['password'];
echo(json_encode($data));
?>