oci_bind_by_name($stmt, ":error", $error, 3); oci_bind_by_name($stmt, ":errorMsg", $errorMsg, 512); oci_bind_by_name($stmt, ":result", $cursor, -1, OCI_B_CURSOR); oci_execute($stmt); if ($error != 0) { echo "<h2 class=\"erro\">Erro: {$errorMsg}</h2>"; } else { echo "\n<table> \n<tr>\n<th>Nome</th>\n<th>Data de Nascimento</th>\n<th> </th>\n</tr>"; oci_execute($cursor); while ($result = oci_fetch_object($cursor)) { echo "\n<tr>\n<td>{$result->AUT_NOME}</td>\n<td>{$result->AUT_DT_NASC}</td>\n</tr>"; } echo "</table>"; } oci_free_statement($stmt); oci_free_cursor($cursor); oci_close($conn); ?> <div class="entry"> <p class="links"><a href="#" class="more">Voltar ao início</a> </p> </div> </div> </div> </div> </div> <!-- start sidebars --> <div id="sidebar1" class="sidebar"> <ul> <li>
public function executeSql($sql, $array = null) { $cur = $this->getOci8Cursor($sql, $array); oci_free_cursor($cur); return true; }
/** * close() only needs to be called if you are worried about using too much * memory while your script is running. All associated result memory for the * specified result identifier will automatically be freed. */ function _close() { if ($this->connection->_stmt === $this->_queryID) { $this->connection->_stmt = false; } if (!empty($this->_refcursor)) { oci_free_cursor($this->_refcursor); $this->_refcursor = false; } @oci_free_statement($this->_queryID); $this->_queryID = false; }
/** * Closes the cursor, enabling the statement to be executed again. * * @return bool TRUE on success or FALSE on failure. */ public function closeCursor() { return oci_free_cursor($this->sth); }