function Close() { if ($this->connection != 0) { OCILogOff($this->connection); $this->connection = 0; $this->affected_rows = -1; $this->uncommitedqueries = 0; } }
echo "<tr>"; echo "<td>Year</td>"; $fg5 = OCIResult($stmt, "YEAR"); echo "<td>"; echo $fg5; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Price</td>"; $fg6 = OCIResult($stmt, "PRICE"); echo "<td>"; echo $fg6; echo "</td>"; echo "</tr>"; } OCILogOff($connect); } ?> </table> <script type="text/javascript"> $(document).ready(function () { $('.slideout-menu-toggle').on('click', function(event){ event.preventDefault(); // create menu variables var slideoutMenu = $('.slideout-menu'); var slideoutMenuWidth = $('.slideout-menu').width(); // toggle open class slideoutMenu.toggleClass("open"); // slide menu
/** * Closes a database connection. * * This is not necessary for any database that uses pooled connections such as * MySQL, but a good programming practice. * * @param resource $conn The database connection * * @return bool True on success, false on error */ function dbi_close($conn) { if (strcmp($GLOBALS["db_type"], "mysql") == 0) { return mysql_close($conn); } else { if (strcmp($GLOBALS["db_type"], "mysqli") == 0) { return mysqli_close($conn); } else { if (strcmp($GLOBALS["db_type"], "mssql") == 0) { return mssql_close($conn); } else { if (strcmp($GLOBALS["db_type"], "oracle") == 0) { return OCILogOff($conn); } else { if (strcmp($GLOBALS["db_type"], "postgresql") == 0) { return pg_close($GLOBALS["postgresql_connection"]); } else { if (strcmp($GLOBALS["db_type"], "odbc") == 0) { return odbc_close($GLOBALS["odbc_connection"]); } else { if (strcmp($GLOBALS["db_type"], "ibm_db2") == 0) { return db2_close($GLOBALS["ibm_db2_connection"]); } else { if (strcmp($GLOBALS["db_type"], "ibase") == 0) { return ibase_close($conn); } else { dbi_fatal_error("dbi_close(): db_type not defined."); } } } } } } } } }
/** * Disconnects from the database server * * @return bool TRUE on success, FALSE on failure */ function disconnect() { if (function_exists('oci_close')) { $ret = @oci_close($this->connection); } else { $ret = @OCILogOff($this->connection); } $this->connection = null; return $ret; }
*/ $dbconn = oci_connect('ndjsb', 'dmndjsb', "(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST=172.24.132.14)(PORT = 1530))(CONNECT_DATA=(SID=jsbdb)))"); //$dbconn=oci_connect('ndjsb','dmndjsb',"//172.24.132.14:1530/jsbdb"); if ($dbconn != false) { echo "连接成功"; $sql = "INSERT INTO splunk_mroom_rtt (CLIENT_REGION, SEND_HOST, AVG_RTT, STDEV_RTT, NUMS, MRTT, MAX_RTT, P25, P75, P95, P99, IQR, REP_DATE) VALUES ('aaa', '115.231.160.100', '0.2', '0.033587', '6', '0.033698000', '0.084954000', '0.011849000', '0.072645000', '0.084954000', '0.084954000', '0.060796000', to_date('2015-05-25','YYYY-MM-DD'))"; insert_data($dbconn, $sql); commit($dbconn); exit; /* $sql = "insert into splunk_mroom_rtt (REP_DATE,CLIENT_REGION,SEND_HOST,AVG_RTT) values(to_date('2015-01-01','YYYY-MM-DD'),'aa','115.231.160.100','0.03554113')"; insert_data($dbconn, $sql); commit($dbconn);*/ $sql = "select to_char(REP_DATE, 'YYYY-MM-DD HH24:MI:SS') as REP_DATE,CLIENT_REGION,SEND_HOST,AVG_RTT,STDEV_RTT,NUMS,MRTT,MAX_RTT,P25,P75,P95,P99,IQR from splunk_mroom_rtt"; select_data($dbconn, $sql); if (OCILogOff($dbconn) == true) { echo "关闭连接成功!"; //=这里有问题 } } else { echo "连接失败"; } exit; function select_data($conn, $sql) { $stid = oci_parse($conn, $sql); oci_execute($stid); while ($row = oci_fetch_array($stid, OCI_BOTH)) { var_dump($row); // Use the uppercase column names for the associative array indices // echo $row[0] . " and " . $row['REP_DATE'] . " are the same<br>\n";
/** * Log out and disconnect from the database. * * @return bool true on success, false if not connected. */ function disconnect() { $ret = @OCILogOff($this->connection); $this->connection = null; return $ret; }
/** * execute a query as DBA * * @param string $query the SQL query * @param mixed $types array that contains the types of the columns in * the result set * @param boolean $is_manip if the query is a manipulation query * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ function &standaloneQuery($query, $types = null, $is_manip = false) { $connection = $this->_doConnect($this->options['DBA_username'], $this->options['DBA_password'], $this->options['persistent']); if (PEAR::isError($connection)) { return $connection; } $offset = $this->offset; $limit = $this->limit; $this->offset = $this->limit = 0; $query = $this->_modifyQuery($query, $is_manip, $limit, $offset); $result =& $this->_doQuery($query, $is_manip, $connection, false); @OCILogOff($connection); if (PEAR::isError($result)) { return $result; } if ($is_manip) { $affected_rows = $this->_affectedRows($connection, $result); return $affected_rows; } $return =& $this->_wrapResult($result, $types, true, false, $limit, $offset); return $return; }
function db_disconnect($cid = -1) { global $db_type; global $debug; global $_connect_id; if ($cid == -1) { $cid = $_connect_id; } if ($db_type == "mysql") { return mysql_close($cid); } else { if ($db_type == "oracle") { return OCILogOff($cid); } } }
/** * execute a query as DBA * * @param string $query the SQL query * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ function standaloneQuery($query) { $connection = $this->_doConnect($this->options['DBA_username'], $this->options['DBA_password'], $this->options['persistent']); if (MDB2::isError($connection)) { return $connection; } $result = @OCIParse($connection, $query); if (!$result) { return $this->raiseError($connection); } if ($this->auto_commit) { $success = @OCIExecute($result, OCI_COMMIT_ON_SUCCESS); } else { $success = @OCIExecute($result, OCI_DEFAULT); } if (!$success) { return $this->raiseError($result); } @OCILogOff($connection); return MDB2_OK; }
/** * execute a query as DBA * * @param string $query the SQL query * @param mixed $types array containing the types of the columns in * the result set * @param boolean $is_manip if the query is a manipulation query * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ function standaloneQuery($query, $types = null, $is_manip = false) { $user = $this->options['DBA_username'] ? $this->options['DBA_username'] : $this->dsn['username']; $pass = $this->options['DBA_password'] ? $this->options['DBA_password'] : $this->dsn['password']; $connection = $this->_doConnect($user, $pass, $this->options['persistent']); if (PEAR::isError($connection)) { return $connection; } $offset = $this->offset; $limit = $this->limit; $this->offset = $this->limit = 0; $query = $this->_modifyQuery($query, $is_manip, $limit, $offset); $result = $this->_doQuery($query, $is_manip, $connection, false); if (!PEAR::isError($result)) { if ($is_manip) { $result = $this->_affectedRows($connection, $result); } else { $result = $this->_wrapResult($result, $types, true, false, $limit, $offset); } } @OCILogOff($connection); return $result; }
// This also includes a link to a details page - Comment Heidi Biggin // Unfortunately all records in the list go to the same page - Comment Heidi Biggin // I was unable to work out how to select ONLY the record that had been selected - Comment Heidi Biggin print( "<li><a href=#pagetwentytwo>" ); // This each individual record into a variable then prints the variable in the list - Comment Heidi Biggin // This will do this for every record in the database in the table selected - Comment Heidi Biggin $fg1 = OCIResult($stmt,"REST_NAME"); print( $fg1); print( "</a></li>" ); } // Close the database connection - Comment Heidi Biggin OCILogOff ($db); ?> <!-- end PHP script - Comment Heidi Biggin--> </ul> </div> </div> <div data-role="footer"> <h1>SIT313 Mobile Computing</h1> </div> </div> </div> <!--PAGE FIFTEEN--> <!--Individual Movie Page-->
function disconnect() { return OCILogOff($this->connectionid); }
function dbi_close($conn) { global $db_connection_info, $db_query_count, $old_textlimit, $old_textsize, $SQLLOG; if (is_array($db_connection_info)) { if (!$db_connection_info['connected']) { // never connected // echo '<!-- No db connection made (cached) -->' . "\n"; return true; } else { $conn = $db_connection_info['connection']; $db_connection_info['connected'] = false; $db_connection_info['connection'] = 0; // echo '<!-- Closing lazy db connection made after ' $db_query_count . " queries -->\n"; } } if (strcmp($GLOBALS['db_type'], 'mysql') == 0) { return mysql_close($conn); } elseif (strcmp($GLOBALS['db_type'], 'mysqli') == 0) { return $conn->close(); } elseif (strcmp($GLOBALS['db_type'], 'mssql') == 0) { if (!empty($old_textlimit)) { ini_set('mssql.textlimit', $old_textlimit); ini_set('mssql.textsize', $old_textsize); } return mssql_close($conn); } elseif (strcmp($GLOBALS['db_type'], 'oracle') == 0) { return OCILogOff($conn); } elseif (strcmp($GLOBALS['db_type'], 'postgresql') == 0) { return pg_close($GLOBALS['postgresql_connection']); } elseif (strcmp($GLOBALS['db_type'], 'odbc') == 0) { return odbc_close($GLOBALS['odbc_connection']); } elseif (strcmp($GLOBALS['db_type'], 'ibm_db2') == 0) { return db2_close($GLOBALS['ibm_db2_connection']); } elseif (strcmp($GLOBALS['db_type'], 'ibase') == 0) { return ibase_close($conn); } elseif (strcmp($GLOBALS['db_type'], 'sqlite') == 0) { return sqlite_close($conn); } else { dbi_fatal_error('dbi_close (): ' . translate('db_type not defined.')); } }
function Disconnect() { if (!DBPersistent && $this->bConnected) { @OCILogOff($this->db_Conn); } }
$_SESSION['firstname'] = $firstname; $_SESSION['lastname'] = $lastname; $_SESSION['postcode'] = $pcode; $_SESSION['state'] = $state; $_SESSION['city'] = $city; $_SESSION['myvar'] = $user; //$_SESSION['firstname'] = $first; //if remember checkbox is checked store the cookie for one month //otherwise store it for two hour /* if($remember == "true") { setcookie("user", $givenname, time()+60*60*24*30); setcookie("cid", $cid, time()+60*60*24*30); } else { setcookie("user", $givenname, time()+3600 *2); setcookie("cid", $cid, time()+3600 *2); } */ //header('Location:home.php'); print "1"; } else { echo "\tInvalid password"; } } else { echo "\tInvalid username"; } OCILogOff($conn);