Howdy.
Can someone tell me - does the oci_free_statement error out when there are no records?
Otherwise, can you tell me why I'd get the "oci_free_statement(): 3 is not a valid" error with this?
$connSelect = oci_connect($usr, $pwd, $db);
$sqlSelect = "SELECT a.myfield FROM mytable ";
$stmt=oci_parse($connSelect,$sqlSelect);
oci_execute($stmt, OCI_DEFAULT);
while (($row = oci_fetch_array($stmt, OCI_BOTH))) {
$myfield = $row[0];
}
$sqlSelect = null;
$row = null;
oci_free_statement($stmt);
oci_close($connSelect);
There are no errors in the SQL, and there are zero records returned. Can't I still free the statement if there are no records? or do I need to add an if statement to free it only when records > 0?