"; $ID = chop(fgets(STDIN)); $sql="lock table ".$tablename." in exclusive mode nowait"; $stmt=oci_parse($con,$sql); $sql="update stock set ITEM_STOCK = ITEM_STOCK -1 where ITEM_ID = ".$ID.""; $stmt=oci_parse($con,$sql); if(!oci_execute($stmt,OCI_DEFAULT)){ oci_rollback($con); }else{ oci_commit($con); } oci_close($con); ?>