本文整理汇总了PHP中OCIResult函数的典型用法代码示例。如果您正苦于以下问题:PHP OCIResult函数的具体用法?PHP OCIResult怎么用?PHP OCIResult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OCIResult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert_value
function convert_value($var)
{
global $db;
$table = $var[table];
$cs = strtoupper($var[cs]);
$cd = $var[cd];
$vd = $var[vd];
$sql = "select {$cs} from {$table} where {$cd}='{$vd}'";
if ($var[print_query] == "1") {
echo "{$sql}";
}
// echo $sql;
$stmt = @OCIParse($this->conn, $sql);
@OCIExecute($stmt, OCI_DEFAULT);
@OCIFetch($stmt);
$result = @OCIResult($stmt, $cs);
@OCIFreeStatement($stmt);
return $result;
}
示例2: htmlentities
// filter special characters
$searchq = htmlentities($searchq, ENT_QUOTES, "UTF-8");
// convert search cases to lower to ignore sensitivity
strtolower($searchq);
$sql = "SELECT * FROM " . $SQL_FROM . " WHERE lower(" . $SQL_WHERE . ") LIKE '%" . $searchq . "%'";
$stmt = OCIParse($db, $sql);
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);
// build result object
while (OCIFetch($stmt)) {
$title = OCIResult($stmt, "TITLE");
$cover = OCIResult($stmt, "COVER");
$id = OCIResult($stmt, "ID");
$output[] = '<div class="new_prod_box">';
$output[] = '<a href="details.php?id=' . $id . '">' . $title . '</a>';
$output[] = '<div class="new_prod_bg">';
$output[] = '<a href="details.php?id=' . $id . '"><img src="bookimages/' . $cover . '" class="thumb" alt="" border="0" /></a>';
$output[] = '</div></div>';
}
// print results
if ($title == "") {
echo "<div class='new_prod_box'><strong>No results, try again</strong></div>";
} else {
echo join('', $output);
}
?>
<div class="clear"></div>
示例3: OCIParse
$user_ID = "";
$email = "";
$phone = "";
$address = "";
$city = "";
$postalcode = "";
$sql = "SELECT * FROM USERS WHERE USERNAME = '" . $_SESSION['username'] . "'";
$stmt = OCIParse($conn, $sql);
OCIExecute($stmt);
while (OCIFetch($stmt)) {
$user_ID = OCIResult($stmt, 'USERID');
$email = OCIResult($stmt, 'EMAIL');
$phone = OCIResult($stmt, 'PHONE');
$address = OCIResult($stmt, 'ADDRESS');
$city = OCIResult($stmt, 'CITY');
$postalcode = OCIResult($stmt, 'POSTAL_CODE');
}
$_SESSION['userid'] = $user_ID;
//print_r("Total amount" . $amount);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-bookstore</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel='stylesheet' type='text/css' href='menustyles.css' />
<script type="text/javascript" src="js/get_book.js"></script>
<script type="text/javascript" src="livevalidation_standalone.compressed.js"></script>
<script type="text/javascript" src="shoppingcart.js"></script>
示例4: OCIParse
$sql = 'SELECT * FROM books WHERE id = ' . $id;
$stmt = OCIParse($db, $sql);
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
$title = OCIResult($stmt, "TITLE");
$author = OCIResult($stmt, "AUTHOR");
$publisher = OCIResult($stmt, "PUBLISHER");
$isbn = OCIResult($stmt, "ISBN");
$year = OCIResult($stmt, "YEAR");
$cover = OCIResult($stmt, "COVER");
$price = OCIResult($stmt, "PRICE");
$description = OCIResult($stmt, "DESCRIPTION");
}
?>
<?php
print '<div class="title"><span class="title_icon"><img src="images/bullet1.gif" alt="" /></span>' . $title . '</div>';
print '<div class="feat_prod_box_details">';
print '<div class="prod_img"><img src="images/' . $cover . '" alt="" border="0" width="98" height="150"/>';
print '<br /><br />';
print '<a href="images/' . $cover . '" rel="lightbox"><img src="images/zoom.gif" alt="" border="0" /></a>';
print '</div>';
?>
<div class="prod_det_box">
<div class="box_top"></div>
示例5: while
</label>
</br></br>
<?php
echo "<select name=\"combo_genero\">";
while (OCIFetch($array_GENERO)) {
$campo_GENERO = OCIResult($array_GENERO, 2);
//aca va la columna
echo "<option value=\"{$campo_GENERO}\">{$campo_GENERO}</option>";
}
echo "</select>";
?>
</td>
<td><?php
echo "<select name=\"combo_CIUDAD\">";
while (OCIFetch($array_CIUDAD)) {
$campo_CIUDAD = OCIResult($array_CIUDAD, 2);
//aca va la columna
echo "<option value=\"{$campo_CIUDAD}\">{$campo_CIUDAD}</option>";
}
echo "</select>";
?>
</td>
<br>
<label class="email">
<span>Email</span><br>
<input id="password" name="password" value="" type="password" placeholder="Email" required><br>
</label>
<label class="password">
<span>Contraseña</span><br>
<input id="password" name="password" value="" type="password" placeholder="Contraseña" required><br>
</label>
示例6: ociparse
}
if ($aocobrarco == 'S') {
print "<center><A HREF=\"consultit.php\" target=\"guia\"><IMG SRC=\"img/volta.gif\" alt=\"Retorna à Página Anterior\" BORDER=0></a></center>";
}
}
}
if ($nrsequencia == '0') {
if ($nrunimed == '127') {
$stmt9 = ociparse($conn, "SELECT CDSERVICO FROM (SELECT CDSERVICO FROM SERVICO_ESPECIALISTA WHERE NRREGISTRO_PREST = '{$result1}' AND CDESPECIALIDADE = '{$cdespecial}' AND CDSERVICO LIKE '0001%' AND (AOEXCLUSAO IS NULL OR AOEXCLUSAO = 'N')) WHERE ROWNUM = '1'");
} else {
$stmt9 = ociparse($conn, "SELECT CDSERVICO FROM(\n SELECT 1 A, CDSERVICO FROM SERVICO_ESPECIALISTA\n WHERE NRREGISTRO_PREST = '{$result1}'\n AND CDESPECIALIDADE = '{$cdespecial}' AND AOSERVICO_CONSULTA = 'S'\n UNION\n SELECT 2 A, CDSERVICO FROM SERVICO_ESPECIALIDADE\n WHERE CDESPECIALIDADE = '{$cdespecial}' AND AOSERVICO_CONSULTA = 'S'\n UNION\n SELECT 3 A, VLPARAMETRO CDSERVICO FROM PARAMETRO\n WHERE CDPARAMETRO = 'SERVCONS')\n WHERE ROWNUM = '1'\n ORDER BY A\n ");
}
OCIdefineByName($stmt9, "cdservico", $cdservico);
OCIexecute($stmt9);
OCIFetch($stmt9);
$result4 = OCIResult($stmt9, 1);
OCIFreeStatement($stmt9);
}
print "<center><form onSubmit=\"return disableForm(this);\" action=\"servc.php?btnptu={$btnptu}\" method=\"POST\" name=\"digitsv\">";
//if (!($sv != !1 and $qt != !1)&&($funcionario == 'AUTOWEB')) {
if (!($sv != !1 and $qt != !1)) {
//RAMON
include "maecad.php";
include "cpfcad.php";
//RAMON
}
if ($nrsequencia == '0') {
echo "<img src=\"img/barra.jpg\" width=\"603\" height=\"3\"><br>\n <font class='nome_campo'>Código: </font>\n <input onKeyUp=\"return autoTab(this, 8, event);\"\n type=\"text\" size=\"8\" maxlength=\"8\"\n name=\"sv\"\n onBlur=\"chkcampo(this,this.value);\"\n value=\"";
if ($result4 != !1) {
echo $result4;
}
示例7: while
<ul data-role="listview">
<!-- This php code fetches the database info above - Comment Heidi Biggin -->
<?php
// fetch each record - Comment Heidi Biggin
while(OCIFetch($stmt))
{
// build list to display results - Comment Heidi Biggin
// 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>
示例8: max
}
// end if
if (!$iserror) {
require_once 'inc/dbconnect.php';
global $db;
// count the record in plants table and use id number $count+1 for the new record
$query_count = "SELECT max(ID) FROM accounts";
/* check the sql statement for errors and if errors report them */
$stmt = OCIParse($db, $query_count);
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);
if (OCIFetch($stmt)) {
$count = OCIResult($stmt, 1);
//returns the data for column 1
//echo $count."</br>";
} else {
echo "An error occurred in retrieving account id.\n";
exit;
}
$count++;
// build INSERT query
$query = "INSERT INTO accounts ( ID, Username, Password, Email, Phone, Address, City, Postcode ) " . "VALUES ( {$count}, '{$uname}', '{$pword}', '{$email}', " . "'" . quotemeta($phone) . "', '{$address}', '{$city}', '{$postcode}' )";
//echo "$query";
/* check the sql statement for errors and if errors report them */
$stmt = OCIParse($db, $query);
//echo "SQL: $query<br>";
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
示例9: readCart
function readCart()
{
global $db;
global $grandtotal;
$cart = $_SESSION['cart'];
if ($cart) {
$items = explode(',', $cart);
$contents = array();
foreach ($items as $item) {
$contents[$item] = isset($contents[$item]) ? $contents[$item] + 1 : 1;
}
$output[] = '<table class="cart_table">';
$output[] = '<tr class="cart_title">';
$output[] = '<td>Book name</td><td>Unit price</td><td>Qty</td><td>Total</td>';
$output[] = '</tr>';
foreach ($contents as $id => $qty) {
$sql = 'SELECT * FROM books WHERE id = ' . $id;
$stmt = OCIParse($db, $sql);
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
$title = OCIResult($stmt, "TITLE");
$author = OCIResult($stmt, "AUTHOR");
$price = OCIResult($stmt, "PRICE");
$id = OCIResult($stmt, "ID");
}
// calculate gst and shipping
$gst = 0.1;
$price = $price + $price * $gst;
$price = number_format($price, 2);
$subtotal = number_format($price * $qty, 2);
$shipping += 4.95 * $qty;
$total += $subtotal + $shipping;
// display items in cart
$output[] = '<tr>';
$output[] = '<td>' . $title . '</td>';
$output[] = '<td>$' . $price . '</td>';
$output[] = '<td>' . $qty . '</td>';
$output[] = '<td>$' . $subtotal . '</td>';
$output[] = '</tr>';
}
// set global totals to use in session
$grandtotal = number_format($total, 2);
$_SESSION['grandtotal'] = $grandtotal;
// display shipping
$totalshipping = number_format($shipping, 2);
$output[] = '<tr>';
$output[] = '<td colspan="3" class="cart_total"><span class="red">TOTAL SHIPPING:</span></td>';
$output[] = '<td>$' . $totalshipping . '</td>';
$output[] = '</tr>';
// display total
$output[] = '<tr>';
$output[] = '<td colspan="3" class="cart_total"><span class="red">GRAND TOTAL:</span></td>';
$output[] = '<td>$' . $grandtotal . '</td>';
$output[] = '</tr>';
$output[] = '</table>';
} else {
$output[] = '<p>Your shopping cart is empty.<br />Order books by selecting the <strong>Order Now</strong> button when viewing book details.</p>';
$grandtotal = 0;
}
return join('', $output);
}
示例10: F_OCIResult
function F_OCIResult($Res, $s)
{
return OCIResult($Res, $s);
}
示例11: while
if (oci_execute($stmt)) {
while (oci_fetch($stmt)) {
$bldg_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
}
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'\n\t\t\t\t\t\t\t\tAND T170_TYPE = 'pkng'\n\t\t\t\t\t\t\t\tORDER BY T170_BLDG_NAME";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
while (oci_fetch($stmt)) {
$pkng_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
}
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'\n\t\t\t\t\t\t\t\tAND T170_TYPE = 'labs'\n\t\t\t\t\t\t\t\tORDER BY T170_BLDG_NAME";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
while (oci_fetch($stmt)) {
$labs_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
}
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME, T170_BLDG_NAME2, T170_ANALYTICS, T170_LINK, T170_LATITUDE, T170_LONGITUDE, T170_ADDRESS, T170_CITY, T170_STATE, T170_ZIP, T170_THUMBNAIL, T170_DESCRIPTION, T170_TYPE, T170_TAGS, T170_IMAGE\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
while (oci_fetch($stmt)) {
$locations .= '{"name": "' . oci_result($stmt, "T170_BLDG_NAME") . '", "analytics_name": "' . oci_result($stmt, "T170_ANALYTICS") . '", "name2": "' . oci_result($stmt, "T170_BLDG_NAME2") . '", "link": "' . oci_result($stmt, "T170_LINK") . '", "location": [' . oci_result($stmt, "T170_LATITUDE") . ', ' . oci_result($stmt, "T170_LONGITUDE") . '], "display_address": "' . oci_result($stmt, "T170_ADDRESS") . '<br />' . oci_result($stmt, "T170_CITY") . ', ' . oci_result($stmt, "T170_STATE") . ' ' . oci_result($stmt, "T170_ZIP") . '", "address": "' . oci_result($stmt, "T170_ADDRESS") . '", "address_maps": "' . oci_result($stmt, "T170_ADDRESS") . ' ' . oci_result($stmt, "T170_CITY") . ', ' . oci_result($stmt, "T170_STATE") . ' ' . oci_result($stmt, "T170_ZIP") . ' [' . oci_result($stmt, "T170_LATITUDE") . ', ' . oci_result($stmt, "T170_LONGITUDE") . ']", "thumb": "' . oci_result($stmt, "T170_THUMBNAIL") . '", "thumb_using_id": "' . oci_result($stmt, "T170_ID") . '", "image": ' . oci_result($stmt, "T170_IMAGE") . ', "description": "' . oci_result($stmt, "T170_DESCRIPTION") . '", "type": "' . oci_result($stmt, "T170_TYPE") . '", "id": "' . oci_result($stmt, "T170_ID") . '", "tags": "' . oci_result($stmt, "T170_TAGS") . '"},';
}
}
oci_free_statement($stmt);
$locations = substr($locations, 0, -1);
示例12: OCIParse
$stmt = OCIParse($conn, $sql);
$givenname = "";
OCIExecute($stmt);
while (OCIFetch($stmt)) {
$user = OCIResult($stmt, 'USERNAME');
//$first = OCIResult($stmt, 'FIRSTNAME');
$passwordDb = OCIResult($stmt, 'PASSWORD');
$email = OCIResult($stmt, 'EMAIL');
$phone = OCIResult($stmt, 'PHONE');
$company = OCIResult($stmt, 'COMPANY');
$address = OCIResult($stmt, 'ADDRESS');
$city = OCIResult($stmt, 'CITY');
$pcode = OCIResult($stmt, 'POSTAL_CODE');
$firstname = OCIResult($stmt, 'FIRSTNAME');
$lastname = OCIResult($stmt, 'LASTNAME');
$state = OCIResult($stmt, 'STATE');
}
if ($user != "") {
if ($passwordDb == $passwordGet) {
$_SESSION['username'] = $user;
$_SESSION['email'] = $email;
$_SESSION['phone'] = $phone;
$_SESSION['company'] = $company;
$_SESSION['address'] = $address;
$_SESSION['firstname'] = $firstname;
$_SESSION['lastname'] = $lastname;
$_SESSION['postcode'] = $pcode;
$_SESSION['state'] = $state;
$_SESSION['city'] = $city;
$_SESSION['myvar'] = $user;
//$_SESSION['firstname'] = $first;
示例13: sql_fetchfield
function sql_fetchfield($field, $rownum = -1, $query_id = 0)
{
if (!$query_id) {
$query_id = $this->query_result;
}
if ($query_id) {
if ($rownum > -1) {
// Reset the internal rownum pointer.
@OCIExecute($query_id, OCI_DEFAULT);
for ($i = 0; $i < $rownum; $i++) {
// Move the interal pointer to the row we want
@OCIFetch($query_id);
}
// Get the field data.
$result = @OCIResult($query_id, strtoupper($field));
} else {
// The internal pointer should be where we want it
// so we just grab the field out of the current row.
$result = @OCIResult($query_id, strtoupper($field));
}
return $result;
} else {
return false;
}
}
示例14: nextid
function nextid($seqname)
{
$this->connect();
$Query_ID = @OCIParse($this->Link_ID, "SELECT {$seqname}.NEXTVAL FROM DUAL");
if (!@OCIExecute($Query_ID)) {
$this->Error = @OCIError($Query_ID);
if (2289 == $this->Error["code"]) {
$Query_ID = OCIParse($this->Link_ID, "CREATE SEQUENCE {$seqname}");
if (!OCIExecute($Query_ID)) {
$this->Error = OCIError($Query_ID);
$this->halt("<BR> nextid() function - unable to create sequence<br>" . $this->Error["message"]);
} else {
$Query_ID = OCIParse($this->Link_ID, "SELECT {$seqname}.NEXTVAL FROM DUAL");
OCIExecute($Query_ID);
}
}
}
if (OCIFetch($Query_ID)) {
$next_id = OCIResult($Query_ID, "NEXTVAL");
} else {
$next_id = 0;
}
OCIFreeStatement($Query_ID);
return $next_id;
}
示例15: OCIExecute
//echo "SQL: $query<br>";
if (!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
//get and store data from results of query
$goalname = OCIResult($stmt, "GOALNAME");
$day = OCIResult($stmt, "DAY");
$month = OCIResult($stmt, "MONTH");
$year = OCIResult($stmt, "YEAR");
$tags = OCIResult($stmt, "TAGS");
$description = OCIResult($stmt, "DESCRIPTION");
$privacy = OCIResult($stmt, "PRIVACY");
$completed = OCIResult($stmt, "COMPLETED");
echo '<div class="data">';
echo '<p>Goalname: ' . $goalname . '</p>';
echo '<p>Date: ' . $day . '/' . $month . '/' . $year . '</p>';
echo '<p>Tags: ' . $tags . '</p>';
echo '<p>Description: ' . $description . '</p>';
echo '<p>Privacy: ' . $privacy . '</p>';
echo '<p>Completed: ' . $completed . '</p>';
echo '</div>';
}
?>
<a href="index.php" class="ui-btn ui-icon-user ui-btn-icon-left ui-corner-all" id = "profilebutton">Return to Profile</a>
</div>
</div>
<!-- End Content -->