What is the equivalent function for mysql_num_rows in OCI (Oracle) when using PHP?
When using OCI (Oracle) with PHP, there is no direct equivalent function for mysql_num_rows. However, you can achieve the same functionality by fetching all rows from the result set and then counting the number of rows returned.
// Assuming $stmt is your OCI statement handle
oci_execute($stmt);
$rowCount = 0;
while ($row = oci_fetch_assoc($stmt)) {
$rowCount++;
}
echo "Number of rows: " . $rowCount;