ciao a tutti...


Codice PHP:
<script type="text/javascript">
    
    var input = document.getElementById('esercente').getElementsByTagName('input');
    </script>
    <?php
    $query 
mysql_query("select * from esercenti where es_0 = '$esercente'");
    while(
$row mysql_fetch_row($query))
    {
        foreach(
$row as $value){
    
?>
    <script type="text/javascript">
        for(var i = 0; i < input.length; i++){
        input[i].value = '<?php echo $value?>';
        }
    
    </script>
    <?php }}
ho scritto questo codice per passare i valori estratti dal database ai campi input tramite javascript ma non va: in tutti i campi input viene inserito il valore delll'ultimo elemento dell'array php $row.

Avete qualche idea?