本文整理汇总了PHP中oci_fetch_row函数的典型用法代码示例。如果您正苦于以下问题:PHP oci_fetch_row函数的具体用法?PHP oci_fetch_row怎么用?PHP oci_fetch_row使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了oci_fetch_row函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginChk
function loginChk($conn)
{
isset($_POST["email"]);
isset($_POST["pass1"]);
global $username, $password, $password_enc;
/* *** A1 - Injection attacks, converted all SQL statments to include binding/placeholders to prevent injection attacks.
*
*/
//check password in database
$s = oci_parse($conn, "SELECT username FROM tblusers WHERE username=:username_prefix AND password=:pw");
oci_bind_by_name($s, ':username_prefix', $username);
oci_bind_by_name($s, ':pw', $password_enc);
oci_execute($s);
//evaluate based on db information
$res = oci_fetch_row($s);
if ($res) {
oci_free_statement($s);
oci_close($conn);
return true;
} else {
oci_free_statement($s);
oci_close($conn);
echo "Username or password were incorrect.</br> Please try to login again, <a href='login.html'>click to return to login page</a>.";
return false;
}
}
示例2: db_fetch_array
function db_fetch_array()
{
$r = array();
while (($row = oci_fetch_row($this->sid)) != false) {
array_push($r, $row);
}
return $r;
}
示例3: lastInsertId
public function lastInsertId($name = '')
{
if (!$name) {
return false;
}
if (($result = oci_parse($this->link, 'SELECT ' . $name . '.CURRVAL FROM dual')) && @oci_execute($result, $this->autocommit ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT)) {
$row = oci_fetch_row($result);
return intval($row[0]);
}
return false;
}
示例4: getReview
function getReview($flightDesc)
{
ini_set('display_errors', 'On');
$db = "w4111c.cs.columbia.edu:1521/adb";
$conn = oci_connect("kpg2108", "test123", $db);
$stmt = oci_parse($conn, "Select u.fname,f.flight_desc,r.travel_date,r.description from review r join flight f on R.FLIGHT_ID = F.FLIGHT_ID join users u on R.USER_ID = u.user_id where F.FLIGHT_DESC = '" . $flightDesc . "'");
oci_define_by_name($stmt, 'NUM_ROWS', $this->num_rows);
oci_execute($stmt);
oci_close($conn);
$arrayOfReviewDetails = array();
while ($row = oci_fetch_row($stmt)) {
$review = new Review();
$review->setFlightName($row[0]);
$review->setFlightDescription($row[1]);
$review->setTravelDate($row[2]);
$review->setReviewDescription($row[3]);
array_push($arrayOfReviewDetails, $review);
}
return $arrayOfReviewDetails;
}
示例5: valid_date
/**
* Created by PhpStorm.
* User: Allan Wiz
* Date: 4/7/15
* Time: 9:01 AM
*/
function valid_date()
{
//Get current system time
global $conn;
$now = time();
//$today=date('l');
//Initialise next working date
$next_working_date_ts = $now;
//Fetch holidays and put them in an array
$holidays = array();
$sql = "Select HDATE FROM HOLIDAYS";
$hdays = oci_parse($conn, $sql);
oci_execute($hdays);
while ($row = oci_fetch_row($hdays)) {
$holidays[] = $row[0];
}
//Get cutoff time
$qru = "select CUTOFF FROM syssettings";
$reslt = oci_parse($conn, $qru) or die(oci_error());
oci_execute($reslt);
$fetch = oci_fetch_row($reslt);
$cutoff = $fetch[0];
$week_days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday');
$weekend_days = array('Saturday', 'Sunday');
if (date('Hi', $now) < $cutoff && in_array(date('l'), $week_days)) {
$next_working_date_ts += 86400;
} else {
if (date('Hi', $now) > $cutoff && in_array(date('l'), $week_days)) {
$next_working_date_ts += 172800;
} else {
}
}
while (in_array(strtoupper(date('d-M-y', $next_working_date_ts)), $holidays) || in_array(date('l', $next_working_date_ts), $weekend_days)) {
$next_working_date_ts += 86400;
if (!in_array(strtoupper(date('d-M-y', $next_working_date_ts)), $holidays) && !in_array(date('l', $next_working_date_ts), $weekend_days)) {
//$next_working_date_ts += 86400;
示例6: getFlightDetails
function getFlightDetails($flightClassId)
{
ini_set('display_errors', 'On');
$db = "w4111c.cs.columbia.edu:1521/adb";
$conn = oci_connect("kpg2108", "test123", $db);
$stmt = oci_parse($conn, "Select F.FLIGHT_DESC,C.Class_name,F.DEPARTURE_DATE,F.ARRIVAL_DATE,A.A_NAME,A1.A_NAME,\r\n\t\tFC.COST , F.FLIGHT_MILES ,FC.NO_OF_SEATS from Flight_class fc join flight f on FC.FLIGHT_ID = f.flight_id join class c on fc.class_id = \r\n\t\tc.class_id join Route r on F.ROUTE_ID = R.ROUTE_ID join airport a on R.DESTINATION_AIRPORT_ID = A.AIRPORT_ID \r\n\t\tjoin airport a1 on R.SOURCE_AIRPORT_ID = A1.AIRPORT_ID where FC.FLIGHT_CLASS_ID='{$flightClassId}'");
oci_execute($stmt);
oci_close($conn);
$flightDetails = new FlightDetails();
while ($row = oci_fetch_row($stmt)) {
$flightDetails->setFlightClassId($flightClassId);
$flightDetails->setflightName($row[0]);
$flightDetails->setclassName($row[1]);
$flightDetails->setdepartureTime($row[2]);
$flightDetails->setarrivalTime($row[3]);
$flightDetails->setdestination($row[4]);
$flightDetails->setsource($row[5]);
$flightDetails->setfare($row[6]);
$flightDetails->setFlightMiles($row[7]);
$flightDetails->setSeatsAvailable($row[8]);
}
return $flightDetails;
}
示例7: displaySkillOptionInfo
function displaySkillOptionInfo()
{
global $conn;
// Get Skill List and ID Form
$skillListSQL = "SELECT S.skillTitle, S.skill_ID FROM SKILL S";
$skillListSTID = oci_parse($conn, $skillListSQL);
// Execute and Check Errors
oci_execute($skillListSTID, OCI_DEFAULT);
$err = oci_error($skillListSTID);
if ($err) {
oci_rollback($conn);
$err_code = $err['code'];
$error_msg = "SKILL LIST RETRIEVE ERROR. Some unknown database error occurred. Please inform database administrator with these error messages.<br>\n" . "Error code : " . $err['code'] . "<br>" . "Error message : " . $err['message'] . "<br>";
echo $error_msg;
} else {
while ($row = oci_fetch_row($skillListSTID)) {
echo "<input type='hidden' name='skill[]' value='" . $row[1] . "'>";
echo "<input type='checkbox' name='skill[]' value='" . $row[1] . "'>" . $row[0];
echo "<select name='skilllevel[]'>\n\t\t\t\t\t\t<option value='0'>0</option>\n\t\t\t\t\t\t<option value='1'>1</option>\n\t\t\t\t\t\t<option value='2'>2</option>\n\t\t\t\t\t\t<option value='3'>3</option>\n\t\t\t\t\t\t<option value='4'>4</option>\n\t\t\t\t\t\t<option value='5'>5</option>\n\t\t\t\t\t\t</select>";
echo "<br>";
}
}
}
示例8: deleteBookings
function deleteBookings($ticketId)
{
ini_set('display_errors', 'On');
$db = "w4111c.cs.columbia.edu:1521/adb";
$conn = oci_connect("kpg2108", "test123", $db);
$stmt10 = "Select ticket_miles from ticket where ticket_id='" . $ticketId . "'";
$stmt11 = oci_parse($conn, $stmt10);
$result11 = oci_execute($stmt11);
$var;
while ($row = oci_fetch_row($stmt11)) {
$var = $row[0];
}
$var = $_SESSION['userMiles'] - $var;
if ($var < 0) {
$var = 0;
}
$stmtUpdate = "update users set Miles='" . $var . "' where user_id='" . $_SESSION['userId'] . "'";
$stmtUpdate1 = oci_parse($conn, $stmtUpdate);
$result3 = oci_execute($stmtUpdate1);
$_SESSION['userMiles'] = $var;
$stmt = "Delete from Payment where ticket_id = '" . $ticketId . "'";
$stmt1 = oci_parse($conn, $stmt);
$result1 = oci_execute($stmt1);
$stmt = "Delete from passenger where ticket_id = '" . $ticketId . "'";
$stmt1 = oci_parse($conn, $stmt);
$result2 = oci_execute($stmt1);
$stmt = "Delete from ticket where ticket_id = '" . $ticketId . "'";
$stmt1 = oci_parse($conn, $stmt);
$result3 = oci_execute($stmt1);
oci_close($conn);
if ($result1 && $result2 && $result3) {
return true;
} else {
echo "false";
}
}
示例9: explode
} else {
require_once 'connection.php';
$tmp = explode("/", $_POST['date']);
$date = "to_date('" . $tmp[2] . "/" . $tmp[0] . "/" . $tmp[1] . "', 'yyyy/mm/dd')";
$sql_sel = "SELECT * FROM Combination C WHERE C.day =" . $date;
$stmt_sel = oci_parse($conn, $sql_sel);
oci_execute($stmt_sel, OCI_DEFAULT);
$err = oci_error($stmt_sel);
if ($err) {
$err_message = "Some unknown error occured: " . $err['message'] . "<br \\>";
} else {
if (empty($stmt_sel)) {
echo "No dressing is planned in the date you selected." . "< br \\>";
} else {
echo "<table>";
while ($sub = oci_fetch_row($stmt_sel)) {
echo "<th>";
echo "<td>Dress type: " . $sub[3] . " </td><td>Purpose: " . $sub[1] . " </td>";
echo "<td><button onclick='browse(" . $sub[0] . ")''>Click me to browse!</button></td>";
echo "</th>";
}
echo "</table>";
}
oci_close($conn);
}
// Show error message.
if (isset($err_message)) {
echo $err_message;
}
}
}
开发者ID:BryantShih,项目名称:Dressing-schedule-website-prototype-with-oracle-database-and-php,代码行数:31,代码来源:calendar.php
示例10: printLayOver
function printLayOver($firstid, $secondid)
{
$layover = oci_fetch_row(executePlainSQL("select F2.departtime-F1.arrivaltime from Flight F1, Flight F2\n\t\t\t\t\t\t\t\t\twhere F1.fid='{$firstid}' AND F2.fid='{$secondid}'"));
$layovertime = parseDate($layover[0], 2);
echo "<br>Lay over for {$layovertime}";
}
示例11: fetchColumn
/**
* {@inheritdoc}
*/
public function fetchColumn($columnIndex = 0)
{
$row = oci_fetch_row($this->_sth);
return $row[$columnIndex];
}
示例12: car
<a href="customers.php"> Customers </a> <br>
<a href="part.php"> Part Lookup </a> <br>
<b> Car Lookup </b> <br>
</div>
<div id=textBody>
<h2> Car Lookup </h2>
<?php
require 'connect.php';
print "Search for a car (case sensitive): <form method=post action=car.php> Make: <input type=text name=MAKE> Model: <input type=text name=MODEL><input type=submit value='Search'></form>";
if (array_key_exists('MAKE', $_POST)) {
if ($_POST['MAKE'] != NULL && $_POST['MODEL'] != NULL) {
$partQuery = oci_parse($conn, "select * from car where make like '%" . $_POST['MAKE'] . "%' and model like '%" . $_POST['MODEL'] . "%' order by 2,3 asc ");
} elseif ($_POST['MAKE'] != NULL && $_POST['MODEL'] == NULL) {
$partQuery = oci_parse($conn, "select * from car where make like '%" . $_POST['MAKE'] . "%' order by 2,3 asc ");
} elseif ($_POST['MAKE'] == NULL && $_POST['MODEL'] != NULL) {
$partQuery = oci_parse($conn, "select * from car where model like '%" . $_POST['MODEL'] . "%' order by 2,3 asc ");
} else {
$partQuery = oci_parse($conn, "select * from car order by 2,3 asc ");
}
oci_execute($partQuery);
print "<table cellpadding=8 cellspacing=3 ><tr><th bgcolor=F5F5CD> Vin Num </th> <th bgcolor=F5F5CD> Make </th> <th bgcolor=F5F5CD> Model </th><th bgcolor=F5F5CD> Year</th><th bgcolor=F5F5CD> Color </th><th bgcolor=F5F5CD> Mileage </th></tr>";
while ($info = oci_fetch_row($partQuery)) {
print "<tr><td bgcolor=F5F5CD>" . $info[0] . "</td><td bgcolor=F5F5CD>" . $info[1] . "</td><td bgcolor=F5F5CD>" . $info[2] . "</td><td bgcolor=F5F5CD>" . $info[3] . "</td><td bgcolor=F5F5CD>" . $info[4] . "</td><td bgcolor=F5F5CD>" . $info[5] . "</td></tr>";
}
print "</table>";
}
?>
</div>
</div>
</body>
</html>
示例13: _fetch_row
protected function _fetch_row()
{
// XXX: There seems to be a bug with oci_fetch_array($this->_result, (OCI_NUM + OCI_RETURN_LOBS))
/*if($this->has_bound_lobs)
{
return @oci_fetch_row($this->_result);
}
return @oci_fetch_array($this->_result, (OCI_NUM + OCI_RETURN_LOBS));*/
$row = @oci_fetch_row($this->_result);
if (!$row) {
return false;
}
if (!$this->has_bound_lobs) {
foreach ($row as &$v) {
if (is_object($v)) {
$v = $v->load();
}
}
}
return $row;
}
示例14: fetch
/**
* Fetches the next row from a result set.
*
* @param int|null $fetchMode Controls how the next row will be returned to
* the caller. This value must be one of the PDO::FETCH_* constants,
* defaulting to value of PDO::ATTR_DEFAULT_FETCH_MODE (which defaults to
* PDO::FETCH_BOTH).
* @param int $cursorOrientation For a PDOStatement object representing a
* scrollable cursor, this value determines which row will be returned to
* the caller. This value must be one of the PDO::FETCH_ORI_* constants,
* defaulting to PDO::FETCH_ORI_NEXT. To request a scrollable cursor for
* your PDOStatement object, you must set the PDO::ATTR_CURSOR attribute
* to PDO::CURSOR_SCROLL when you prepare the SQL statement with
* PDO::prepare.
* @param int $cursorOffset [optional]
* @return mixed The return value of this function on success depends on the
* fetch type. In all cases, FALSE is returned on failure.
* @todo Implement cursorOrientation and cursorOffset
*/
public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
{
// If not fetchMode was specified, used the default value of or the mode
// set by the last call to setFetchMode()
if ($fetchMode === null) {
$fetchMode = $this->fetchMode;
}
// Convert array keys (or object properties) to lowercase
$toLowercase = $this->getAttribute(PDO::ATTR_CASE) == PDO::CASE_LOWER;
// Convert null value to empty string
$nullToString = $this->getAttribute(PDO::ATTR_ORACLE_NULLS) == PDO::NULL_TO_STRING;
// Convert empty string to null
$nullEmptyString = $this->getAttribute(PDO::ATTR_ORACLE_NULLS) == PDO::NULL_EMPTY_STRING;
// Determine the fetch mode
switch ($fetchMode) {
case PDO::FETCH_BOTH:
$rs = oci_fetch_array($this->sth);
// Fetches both; nice!
if ($rs === false) {
return false;
}
if ($toLowercase) {
$rs = array_change_key_case($rs);
}
if ($this->returnLobs && is_array($rs)) {
foreach ($rs as $field => $value) {
if (is_object($value)) {
$rs[$field] = $value->load();
}
}
}
return $rs;
case PDO::FETCH_ASSOC:
$rs = oci_fetch_assoc($this->sth);
if ($rs === false) {
return false;
}
if ($toLowercase) {
$rs = array_change_key_case($rs);
}
if ($this->returnLobs && is_array($rs)) {
foreach ($rs as $field => $value) {
if (is_object($value)) {
$rs[$field] = $value->load();
}
}
}
return $rs;
case PDO::FETCH_NUM:
$rs = oci_fetch_row($this->sth);
if ($rs === false) {
return false;
}
if ($this->returnLobs && is_array($rs)) {
foreach ($rs as $field => $value) {
if (is_object($value)) {
$rs[$field] = $value->load();
}
}
}
return $rs;
case PDO::FETCH_COLUMN:
$rs = oci_fetch_row($this->sth);
$colno = (int) $this->fetchColNo;
if (is_array($rs) && array_key_exists($colno, $rs)) {
$value = $rs[$colno];
if (is_object($value)) {
return $value->load();
} else {
return $value;
}
} else {
return false;
}
break;
case PDO::FETCH_OBJ:
case PDO::FETCH_INTO:
case PDO::FETCH_CLASS:
case PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE:
$rs = oci_fetch_assoc($this->sth);
if ($rs === false) {
//.........这里部分代码省略.........
示例15: sql_fetch_row
public function sql_fetch_row($res)
{
return oci_fetch_row($res);
}