Updating table "php_test" 1002 for update'))){ $cursor = odbc_cursor($result); if(($upd = odbc_prepare($conn,"update php_test set a=?, b=? where current of $cursor"))){ while(odbc_fetch_row($result)) { $params[0] = odbc_result($result, 1) . "(*)"; $params[1] = odbc_result($result, 2) + 2000; odbc_execute($upd, $params); } odbc_commit($conn); } } if($result && $upd){ ?> - OK
A | B | C | D |
---|---|---|---|
test-1 | 1001 | 100.01 | php3 - values 1 |
test-2 | 1002 | 200.02 | php - values 2 |
test-3(*) | 3003 | 300.03 | php - values 3 |
test-4(*) | 3004 | 400.04 | php - values 4 |
test-5(*) | 3005 | 500.05 | php - values 5 |
Note: If you reload this testpage, the three last rows will contain different values in columns A and B |