Saluti a tutti!

Ho qualche problema con l'aggiornamento di campi singoli di un database, ho idea di dove possa essere l'errore, ma non so come risolverlo, causa inesperienza (sono un novellino).

Premesso che i campi delle tabelle dei database sono esatti (previo controllo e ricontrollo di sicurezza) la mia pagina di visualizzazione dei campi (dove l'errore temo sia al momento della href di modifica) è questa:

ormad.php

Codice PHP:
<?php
$DB_host     
'xxxxx';
$DB_user     'yyyyyyy';
$DB_password 'zzzzzzzz';
$DB_name     'wwwwww';

$link mysql_connect($DB_host$DB_user$DB_password);
if (!
$link) {
    die (
'Non riesco a connettermi: ' mysql_error());
}

$db_selected mysql_select_db($DB_name$link);
if (!
$db_selected) {
    die (
"Errore nella selezione del database: " mysql_error());

}
session_start();
$q=mysql_query("SELECT * FROM orders WHERE archived=0 ORDER BY vessel, datasped, supplier, orderno");



if(isset(
$_POST['delete'])){
    
$arr=$_POST['delete'];
    foreach(
$arr as $item){
        
mysql_query("Delete From orders Where id=".$item);
    }
}

if(isset(
$_POST['archive'])){
    
$arr=$_POST['archive'];
    foreach(
$arr as $item){
        
mysql_query("Update orders Set archived=true Where id=".$item);
    }
}




?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stile.css"> 
</head>
<body>
[img]eurotitle.png[/img]    
<form method="post" action="">
<table align="center">
     <thead>
     <th align=center>ID</th>
     <th align=center>DATE</th>
     <th align=center>VESSEL</th>
     <th align=center>ORDER N.</th>
     <th align=center>SUPPLIER</th>
     <th align=center>PIECES</th>
     <th align=center>WEIGHT</th>
     <th align=center>DATA SPEDIZIONE</th>
     <th align=center>LUOGO SPEDIZIONE</th>
     <th align=center>NOTE</th>
     <th align=center>AZIONI</th>
<th align=center></th>
     </thead>
<?php while ($row=mysql_fetch_array($q)) : ?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['date']; ?></td>
<td>[b]<?php echo $row['vessel']; ?>[/b]</td>
<td><?php echo $row['orderno']; ?></td>
<td><?php echo $row['supplier']; ?></td>
<td><?php echo $row['pieces']; ?></td>
<td><?php echo $row['peso']; ?></td>
<td><?php echo $row['datasped']; ?></td>
<td><?php echo $row['luogosped']; ?></td>
<td><?php echo $row['note']; ?></td>
<td><label>Elimina <input type="checkbox" name="delete[]" value="<?php echo $row['id']; ?>"></label></td>
<td><label>Archivia <input type="checkbox" name="archive[]" value="<?php echo $row['id']; ?>"></label></td>
<td>[url="modify.php?id=' . $row['id'] . '"]Modifica[/url]</td>
        
</tr>
<?php endwhile; ?>
<tr>
            <td colspan="11" align="right"><input type="submit" value="Esegui Azioni"></td>
        </tr> 
</table>
</form>

<?php
    $array2
=$_SESSION['diritti_utente'];
    
$q2=mysql_query("SELECT SUM(pieces) AS 'somma_pezzi' FROM orders WHERE archived=0");
    
$q3=mysql_query("SELECT SUM(peso) AS 'somma_peso' FROM orders WHERE archived=0");    
    
$r2=mysql_fetch_assoc($q2);
    
$r3=mysql_fetch_assoc($q3);
    
?>


    <p align="center">TOTALI:</p>
    <p align="center">Totale quantita': <?php echo $r2['somma_pezzi']; ?></p>
    <p align="center">Totale peso: <?php echo $r3['somma_peso']; ?></p>
    
    

[b][url="javascript:history.back()"]INDIETRO[/url][/b]</p>

    
</body>
</html>


Il link di modifica porta a modify.php, creato così:
Codice PHP:
<?php
$DB_host     
'xxxxx';
$DB_user     'yyyyyyy';
$DB_password 'zzzzzzzz';
$DB_name     'wwwwww';

$link mysql_connect($DB_host$DB_user$DB_password);
if (!
$link) {
    die (
'Non riesco a connettermi: ' mysql_error());
}

$db_selected mysql_select_db($DB_name$link);
if (!
$db_selected) {
    die (
"Errore nella selezione del database: " mysql_error());

}
session_start();

$sql "SELECT * FROM orders WHERE id='$_GET[id]'";
$res mysql_query($sql);
$row mysql_fetch_array($res);

echo 
'
<form action="modify_data.php" method="POST">
Vessel:

<input type="text" name="vessel" value="' 
$row['vessel'] . '" />


Data:

<input type="text" name="date" value="' 
$row['date'] . '"/>


N.Ordine:

<input type="text" name="orderno" value="' 
$row['orderno'] . '"/>


Supplier:

<input type="text" name="supplier" value="' 
$row['supplier'] . '"/>


Data Spedizione:

<input type="text" name="datasped" value="' 
$row['datasped'] . '"/>


Luogo Spedizione:

<input type="text" name="luogosped" value="' 
$row['luogosped'] . '"/>


N.Pezzi:

<input type="text" name="pieces" value="' 
$row['pieces'] . '"/>


Peso:

<input type="text" name="peso" value="' 
$row['peso'] . '"/>


Note:

<input type="text" name="note" value="' 
$row['note'] . '"/>


<input type="hidden" value="' 
$_GET['id'] . '" name="id" />
<input type="submit" value="modifica" />
</form>
'
?>


per terminare con l'update che è dentro modify_data.php:
Codice PHP:
<?php
$DB_host     
'xxxxx';
$DB_user     'yyyyyyy';
$DB_password 'zzzzzzzz';
$DB_name     'wwwwww';

$link mysql_connect($DB_host$DB_user$DB_password);
if (!
$link) {
    die (
'Non riesco a connettermi: ' mysql_error());
}

$db_selected mysql_select_db($DB_name$link);
if (!
$db_selected) {
    die (
"Errore nella selezione del database: " mysql_error());

}
session_start();

$sql "UPDATE orders SET vessel='$_POST[vessel]', date='$_POST[date]', orderno='$_POST[orderno]', supplier='$_POST[supplier]', datasped='$_POST[datasped]', luogosped='$_POST[luogosped]', pieces='$_POST[pieces]', peso='$_POST[peso]', note='$_POST[note]' WHERE id='$_POST[id]'";

mysql_query($sql);

header("Location: ormad.php");
?>
Il risultato è che la modifica del campo non avviene, ed ovviamente togliendo da WHERE in poi nella UPDATE, modifica tutti i campi della tabella.


Come detto temo che il problema sia in ormad.php, probabilmente nell'href, ma non ho idea di come modificare per renderlo funzionante, maledetto niubbo che non sono altro.

E' tutto, se manca qualcosa chiedete pure, lietissimo di dare altre informazioni chiarirvi le idee su questo caos

Grazie in anticipo a chiunque mi possa aiutare!