I used the following code trying to display the total number of records and then dispaly all records. However, I can only be able to get the count number after the loop. How can I print the count number before printing the actual records?
-------------------the code--------------------------
$conn = // details omitted
$query = "select username, password from usertable";
$stmt = ociparse($conn,$query);
OCIDefineByName($stmt,"USERNAME",$username);
OCIDefineByName($stmt,"PASSWORD",$password);
OCIExecute($stmt);
while (OCIFetch($stmt)) {
print $username. " ". $password."/n";
}
$total_record = OCIRowCount($stmt);
print $total_record. " total records available".