/** *Execução de comandos padrões de consulta a banco (SELECT, INSERT, UPDATE, DELETE, CREATE...) *@name execute() *@return ObjectQuery **/ public function Execute($argSql, $argName = NAME_QUERY) { global $result; # call the connect database method $sqli = $this->conn->__conecta(); # instancia as variáveis $this->sql = $argSql; $this->name = $argName; //echo $this->dbtype; //exit; if ($this->conn->typedb == "mysql") { try { # execute sql command $result = $sqli->query($this->sql); # fecha a conexão com o banco de dados $sqli->close(); # retorno do método return $result; } catch (Exception $e) { echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n"; } } if ($this->conn->typedb == "oracle") { try { $result = oci_parse($sqli, $this->sql); oci_execute($result); oci_commit($sqli); OCILogoff($sqli); return $result; } catch (Exception $e) { OCILogoff($sqli); echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n"; } } }
public function closeConnection() { $this->freeResults(); if ($this->connection != null) { OCILogoff($this->connection); } }
function sql_close() { if ($this->db_connect_id) { // Commit outstanding transactions if ($this->in_transaction) { OCICommit($this->db_connect_id); } if ($this->query_result) { @OCIFreeStatement($this->query_result); } $result = @OCILogoff($this->db_connect_id); return $result; } else { return false; } }
function _close() { if (!$this->_connectionID) return; if (!$this->autoCommit) OCIRollback($this->_connectionID); if (count($this->_refLOBs) > 0) { foreach ($this ->_refLOBs as $key => $value) { $this->_refLOBs[$key]['LOB']->free(); unset($this->_refLOBs[$key]); } } OCILogoff($this->_connectionID); $this->_stmt = false; $this->_connectionID = false; }
</script> <?php } } } // Fetch the customer profile based on the cid from cookies $q = "select * from Customer where cid = '" . $cid . "'"; $result = executePlainSQL($q); $row = OCI_Fetch_Array($result, OCI_BOTH); $cname = $row['CNAME']; $email = $row['EMAIL']; $addr = $row['ADDRESS']; $phone = $row['PHONE']; $passport_country = $row['PASSPORT_COUNTRY']; $passport_num = $row['PASSPORT_NUM']; OCILogoff($db_conn); } ?> <div class="content-customer-area"> <p>Edit your profile:</p> <form class="pure-form pure-form-aligned" method="POST" action="profile.php"> <fieldset> <div class="pure-control-group"> <label for="name">Name</label> <input id="name" type="text" name="cname" value="<?php echo $cname; ?> "> </div>
/** * This function will close the database connection. */ function close() { if ($this->_conn != null) { $this->_conn = null; @OCILogoff($this->_conn); } }
function _close() { if (!$this->autoCommit) { OCIRollback($this->_connectionID); } OCILogoff($this->_connectionID); $this->_stmt = false; $this->_connectionID = false; }
public function close() { $this->gc(ini_get('session.gc_maxlifetime')); return OCILogoff(self::$_db); }
<input type="button" onclick="crearEvento()" value="Crear evento"></input> </div> </body> <?php include "conexion.php"; $conn = OCILogon($user, $pass, $db); $outrefc = ocinewcursor($conn); //Declare cursor variable $mycursor = ociparse($conn, "begin get_AllTeams(:curs); end;"); // prepare procedure call ocibindbyname($mycursor, ':curs', $outrefc, -1, OCI_B_CURSOR); // bind procedure parameters $ret = ociexecute($mycursor); // Execute function $ret = ociexecute($outrefc); // Execute cursor $nrows = ocifetchstatement($outrefc, $data); // fetch data from cursor ocifreestatement($mycursor); // close procedure call ocifreestatement($outrefc); // close cursor //var_dump($data); echo " <div id ='subStadiumBox'class='subStadiumBox'>"; for ($p = 0; $p < count($data["NAME_TEAM"]); $p++) { $nombre = $data["NAME_TEAM"][$p]; echo "<script type='text/javascript'>anadirEquipo('{$nombre}');</script>"; } OCILogoff($conn);
function close() { if ($this->Query_ID) { $this->free_result(); } if ($this->Connected && !$this->Persistent) { OCILogoff($this->Link_ID); $this->Connected = false; } }
/** * db::disconnect() * * @return **/ function disconnect() { global $GonxAdmin; switch ($GonxAdmin["dbtype"]) { case "mysql": @mysql_close($this->Link_ID); break; case "postgresql": @pg_close($this->Link_ID); break; case "mssql": @mssql_close($this->Link_ID); break; case "sqlite": break; case "oracle": @OCILogoff($this->Link_ID); break; } }
$username = $_POST['username']; $password = $_POST['pwd']; if ($password == null) { echo '<font color="' . red . '">Password cannot be blank. Please enter a valid password</font>'; echo "<br/><br/>"; echo "<a href='http://uisacad.uis.edu/~kmulpu2/PasswordReset.html'>Back To Password Reset Page</a>"; exit; } $connection = ocilogon("tanis2", "oracle", "oracle.uis.edu"); $sqlquery = "UPDATE CREDENTIALS SET password='******' WHERE username='******'"; $sql_id = ociparse($connection, $sqlquery); if (!$sql_id) { $e = oci_error($connection); echo "The following error occured:"; print htmlentities($e['message']); exit; } $returnValue = ociexecute($sql_id, OCI_DEFAULT); if ($returnValue == 1) { echo '<font color="' . blue . '">Password was reset successfully</font>'; ocicommit($connection); echo "<br/><br/>"; echo "<a href='http://uisacad.uis.edu/~kmulpu2/DillardsReporting.html'>Back To Login Page</a>"; } else { echo '<font color="' . red . '">Unable to reset password due to server issues. Please try again later</font>'; } OCIFreeStatement($sql_id); OCILogoff($connection); ?> </body> </html>
function disconnect() { if ($this->Debug) { printf("Disconnecting...<br>\n"); } OCILogoff($this->Link_ID); }
function destruct() { @OCIFreeStatement($this->stmt); @OCILogoff($this->conn); return TRUE; }
<html> <?php if ($c = OCILogon("ora_p2n8", "a36523124", "ug")) { echo "Successfully connected to Oracle.\n"; OCILogoff($c); } else { $err = OCIError(); echo "Oracle Connect Error " . $err['message']; } ?> </html>