Have done the following code to retrieve values from an Oracle table and create a list of radio buttons.:
$query = "SELECT payment_id,payment_name
FROM $paymentTable
WHERE subscription_code = $grid
AND region_lookup = '$regionCode'
AND payment_id NOT IN (SELECT payment_id FROM PUNTER_SUB_SINGLE_PAYMENTS
WHERE punter_code= $custref)";
$curser = @OCIPARSE($connection,$query);
if ( ! $result = @OCIExecute($curser)) {
$err = OCIError($curser);
$errorMsg = $err["code"]." ".$err[ "message" ];
error_log ("Date: $currentDate Message: Could not get the payment details for subscription $grid in credit_card.php, ErrorMsg: $e
rrorMsg, User $custref, Query $query\n", 3, "$logfile");
}
$radioHTML= "";
while (@OCIFetchInto($curser,&$dataArray,OCI_ASSOC+OCI_RETURN_NULLS)) {
$id = $dataArray['PAYMENT_ID'];
$name = $dataArray['PAYMENT_NAME'];
$radioHTML .="<input type=radio name=payment_list value=$id >$name<br>";
}
I want to find out how many rows have been retrieved as I will do different stuff depending on whether I have one or many rows (I want to check a radio button if there is one row but leave all radio buttons unchecked of there is more than one).