在PHP / mySQL / JQuery环境中填充56个输入字段

I have a form that takes 56 separate inputs and stores them across 6 tables in mySQL indexed by a unique ID generated when the form is generated. That said, I have an edit mode that passes the UID to the form via the GET method (ie. index.php?editUID=5552d631220810).

My question is, what is the best way to assign all the values to each of the 56 inputs? Currently I am using PHP to process a script line to assign each of the values which are set in the database like this:

<script type="text/javascript" language="javascript">
            $(function() {
            $("#salesPrice").val("7500000");
            });
</script>

But this seems like a cumbersome / not very efficient way to assign my values to their respective fields. Is there a cleaner way to do this? Also, if this is helpful, the names of my mySQL fields are the same as my inputs (ie. salesPrice is the name of the column in my database and the name of the index of my input field if that is useful).

Thanks for any ideas.

You could loop through the column names and the variables and output them to both the HTML and the Javascript

<?php

//MYSQL query goes here

for($results as $data) {

   ?>

$("#<?php echo $data->name; ?>").val("<?php echo $data->value; ?>");

<?php

}

?>

Or simply just use it with HTML and no javascript

<?php

//MYSQL query goes here

for($results as $data) {

   ?>

<input type="text" name="<?php echo $data->name; ?>" value="<?php echo $data->value; ?>">

<?php

}

?>