Best way to update a large amount of items in a MySQL Database
<p>I'd like to think that there's a simple way of doing this. I have over thirty columns in a database that I need to update. All of the columns have the same name as the correlating session variables. </p>

<p>Here's my code to fetch the array and assign variables:</p>

<pre><code>    while ($row = mysql_fetch_array($result))
    {   
        $_SESSION['PendingCivil'] = $row['PendingCivil'];
        $_SESSION['PendingAsbestos'] = $row['PendingAsbestos'];
        $_SESSION['PendingDomestic'] = $row['PendingDomestic'];
        $_SESSION['AsgNewCivil'] = $row['AsgNewCivil'];
        $_SESSION['AsgNewAsbestos'] = $row['AsgNewAsbestos'];
        $_SESSION['AsgNewDomestic'] = $row['AsgNewDomestic'];
        $_SESSION['AsgTransferCivil'] = $row['AsgTransferCivil'];
        $_SESSION['AsgTransferAsbestos'] = $row['AsgTransferAsbestos'];
        $_SESSION['AsgTransferDomestic'] = $row['AsgTransferDomestic'];
        $_SESSION['AsgReopenedCivil'] = $row['AsgReopenedCivil'];
        $_SESSION['AsgReopenedAsbestos'] = $row['AsgReopenedAsbestos'];
        $_SESSION['AsgReopenedDomestic'] = $row['AsgReopenedDomestic'];
        $_SESSION['DispWOPCivil'] = $row['DispWOPCivil'];
        $_SESSION['DispWOPAsbestos'] = $row['DispWOPAsbestos'];
        $_SESSION['DispWOPDomestic'] = $row['DispWOPDomestic'];
        $_SESSION['DispFinalCivil'] = $row['DispFinalCivil'];
        $_SESSION['DispFinalAsbestos'] = $row['DispFinalAsbestos'];
        $_SESSION['DispFinalDomestic'] = $row['DispFinalDomestic'];
        $_SESSION['DispBTCivil'] = $row['DispBTCivil'];
        $_SESSION['DispBTAsbestos'] = $row['DispBTAsbestos'];
        $_SESSION['DispBTDomestic'] = $row['DispBTDomestic'];
        $_SESSION['DispJTCivil'] = $row['DispJTCivil'];
        $_SESSION['DispJTAsbestos'] = $row['DispJTAsbestos'];
        $_SESSION['DispJTDomestic'] = $row['DispJTDomestic'];
        $_SESSION['DispTOCivil'] = $row['DispTOCivil'];
        $_SESSION['DispTOAsbestos'] = $row['DispTOAsbestos'];
        $_SESSION['DispTODomestic'] = $row['DispTODomestic'];
        $_SESSION['OldCivil'] = $row['OldCivil'];
        $_SESSION['OldAsbestos'] = $row['OldAsbestos'];
        $_SESSION['OldDomestic'] = $row['OldDomestic'];
    }
</code></pre>

<p>Basically I'd like to update each row with a (possibly) changed session variable on an update page. Is there a way to iterate through the session variables and update the corresponding columns? Note: I have other session variables set that are not in the DB.</p>
