Hi!
I am using php and oracle to record accidents, so i first record an accident and some details to next, maintaining the accident id in
" $acdt_seq "
to record one by one the n cars crashed in this accident....
So i need manually to record the car sequence in this accident, ( do not use the oracle sequences... ) maintaining this unique accident id
so i do select max() the cars sequence, and get the
" seq_car "
variable wich must be the last car sequence on the accident:
$cmdstr_seq = "SELECT MAX( SEQ_CARS ) ".
"FROM CRASHED_CARS ".
"WHERE ACDT_SEQ = '$acdt_seq'";
$parsed_seq = ociparse( $db_conn, $cmdstr_seq );
ociexecute( $parsed_seq );
$nrows_seq = ocifetchstatement( $parsed_seq, $results_seq );
for ( $i = 0; $i < $nrows_seq; $i++ ) {
$seq_car = $results_seq["SEQ_CARS"][$i];
}
OCILogoff($db_conn);
And increment the sequence retrieved with the code below:
if ( $seq_car < 1 ){
$seq_car = 1;
} else {
$seq_car = ++$seq_car;
}
i think it would work but it is not, i am not seeing an error in this code. A help would be apreciated...
Cheers