PHP : Function Reference : ODBC Functions (Unified) : odbc_cursor
Examples ( Source code ) » odbc_cursor
<?php
odbc_autocommit($conn, 0);
if(($result = odbc_do($conn, 'select * from php_test where Col2>1002 for update'))){
$cursor = odbc_cursor($result);
if(($upd = odbc_prepare($conn,"update php_test set Col1=?, Col2=? 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){
?>
|