jQuery - 如何将数组从PHP发送到html文本框

I want to autofill the user form when a user is selected. How can I pass through an array from php to javacript/jquery and then put the values into the correct textboxes?

$("#client").change(function() {
     $.get("../jquery/update_client.php?id=" + $("#client").val(),function(data){
          $("#first").val(data);
     });
});

PHP file:

if(isset($_GET['id'])){
include('../db_connect.php');
$id = mysqli_real_escape_string($mysqli, $_GET['id']);
$query = "SELECT * FROM users WHERE iduser=$id LIMIT 1";
$result = $mysqli->query($query);
$row = $result->fetch_array();
echo $row[];
}

How can I capture the array in javacript/jquery and then parse the information to go into the right boxes?

In PHP;

echo json_encode($row);

In JavaScript you will now get a map (array) back as data. This map you can then loop to fill your textbox(es).

Maybe if you output JSON it's better to use getJSON method with a simple for loop to set corresponding fields values:

$.getJSON("../jquery/update_client.php?id=" + $("#client").val(), function(data) {
    for (var el in data) {
        $('[name="' + el + '"]').val(data[el]);
    };
});

http://jsfiddle.net/2LuuC/

well in php output the data as json. that is use

echo (json_encode($data));

then as dfsq said