本文整理汇总了PHP中ociresult函数的典型用法代码示例。如果您正苦于以下问题:PHP ociresult函数的具体用法?PHP ociresult怎么用?PHP ociresult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ociresult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_ams_student
public function get_ams_student($student_id = NULL)
{
$conn = oci_connect('AMS_QUERIES', 'Oo_Hecha1_rohm3', '//192.168.170.171:1522/ACADEMIC');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
} else {
if ($student_id == NULL) {
$sql = "SELECT * FROM GAOWNER.VIEW_STUDENT_DETAILS";
} else {
$sql = 'SELECT * FROM GAOWNER.VIEW_STUDENT_DETAILS WHERE STUDENT_NO LIKE \'%' . $student_id . '%\'';
}
$rs4 = oci_parse($conn, $sql);
oci_execute($rs4);
$rows = oci_num_rows($rs4);
$t = 0;
while (OCIFetch($rs4)) {
$t++;
$name1 = ociresult($rs4, "SURNAME");
$dob = ociresult($rs4, "DOB");
$gender = ociresult($rs4, "GENDER");
$oname1 = ociresult($rs4, "OTHER_NAMES");
$STUDENT_NO = ociresult($rs4, "STUDENT_NO");
$COURSES = ociresult($rs4, "COURSES");
$GUARDIAN_NAME1 = ociresult($rs4, "GUARDIAN_NAME");
$MOBILE_NO = ociresult($rs4, "MOBILE_NO");
$EMAIL = ociresult($rs4, "EMAIL");
$FACULTIES = ociresult($rs4, "FACULTIES");
// details to be saved
$name = str_replace("'", "", "{$name1}");
$oname = str_replace("'", "", "{$oname1}");
$GUARDIAN_NAME = str_replace("'", "", "{$GUARDIAN_NAME1}");
if (!empty($STUDENT_NO)) {
$exists = $this->student_exists($STUDENT_NO);
$data = array('title' => '', 'Surname' => $name, 'Other_names' => $oname, 'DOB' => $dob, 'contact' => $MOBILE_NO, 'gender' => $gender, 'student_Number' => $STUDENT_NO, 'courses' => $FACULTIES, 'GUARDIAN_NAME' => $GUARDIAN_NAME, 'faculty' => $FACULTIES);
if (!$exists) {
$this->db->insert('student', $data);
} else {
$this->db->where('student_Number', $STUDENT_NO);
$this->db->update('student', $data);
}
$date = date("Y-m-d H:i:s");
// data for patients patient date, visit type, strath number created by and modified by fields
if ($student_id != NULL) {
$patient_data = array('patient_number' => $this->create_patient_number(), 'patient_date' => $date, 'visit_type_id' => 1, 'strath_no' => $STUDENT_NO, 'created_by' => $this->session->userdata('personnel_id'), 'modified_by' => $this->session->userdata('personnel_id'));
$this->db->insert('patients', $patient_data);
return $this->db->insert_id();
}
} else {
$this->session->set_userdata("error_message", "Student could not be found");
return FALSE;
}
}
if ($student_id != NULL) {
return TRUE;
}
}
}
示例2: ocilogon
<h1>PHP und Oracle</h1>
<table border="1">
<tr>
<th>Interpret</th>
<th>Titel</th>
<th>Jahr</th>
</tr>
<?php
$db = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)\r\n (HOST=localhost) (PORT=1521)))\r\n (CONNECT_DATA=(SERVICE_NAME=xe)))";
// Oracle 10g
//$db="//localhost/xe";
$c = ocilogon("hr", "geheim", $db);
$s = ociparse($c, "SELECT * FROM cds");
if (ociexecute($s)) {
while (ocifetch($s)) {
echo "<tr>";
echo "<td>" . ociresult($s, "INTERPRET") . "</td>";
echo "<td>" . ociresult($s, "TITEL") . "</td>";
echo "<td>" . ociresult($s, "JAHR") . "</td>";
echo "</tr>";
}
} else {
$e = oci_error($s);
echo htmlentities($e['message']);
}
?>
</table>
</body>
</html>
示例3: ociresult
</td>
<td>
<input type="text" name="txtcargo" class="txt" value='<?php
echo ociresult($stmt, "NM_CARGO");
?>
'/>
</td>
<td>
<input type="text" name="txtusuario" class="txt" value='<?php
echo ociresult($stmt, "NM_USUARIO");
?>
'/>
</td>
<td>
<input type="password" name="txtsenha" class="txt" value='<?php
echo ociresult($stmt, "NM_SENHA");
?>
'/>
</td>
</tr>
<tr>
<td colspan="8">
<input type="submit" value="Atualizar" name="btsalvar" class="bt" title="Clique para salvar."/>
</td>
</tr>
</table>
</form>
</div>
<?php
oci_free_statement($stmt);
}
示例4: oci_parse
</td>
<td colspan="2">
<label class="lb">Configurações:</label>
</td>
</tr>
<?php
//Seleciona todos os funcionários cadastrados
$stmt = oci_parse($conexao, "SELECT * FROM Cargo");
oci_execute($stmt, OCI_DEFAULT);
while (Ocifetch($stmt)) {
$id = ociresult($stmt, "CD_CARGO");
?>
<tr>
<td>
<input type="text" name="txtcargo" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_CARGO");
?>
'/>
</td>
<td>
<?php
echo "<a href='ConCargo.php?Atualizar&I={$id}' class='bt'>Atualizar</a>";
?>
</td>
<td>
<?php
echo "<a href='ConCargo.php?Excluir&I={$id}' class='bt'>Excluir</a>";
?>
</td>
</tr>
<?php
示例5: ociresult
</td>
<td>
<input type="text" name="txtdestinatario" readonly="readonly" class="txt" value='<?php
echo ociresult($stmt, "NM_DESTINATARIO");
?>
'/>
</td>
<td>
<input type="text" name="txtmalote" readonly="readonly" class="txt2" value='<?php
echo ociresult($stmt, "CD_MALOTE");
?>
'/>
</td>
<td>
<input type="text" name="txtprotocolo" readonly="readonly" class="txt1" value='<?php
echo ociresult($stmt, "CD_PROTOCOLO");
?>
'/>
</td>
<td>
<?php
echo "<a href='ConCorrespondencia.php?Atualizar&I={$id}' class='bt'>Atualizar</a>";
?>
</td>
<td>
<?php
echo "<a href='ConCorrespondencia.php?Excluir&I={$id}' class='bt'>Excluir</a>";
?>
</td>
</tr>
<?php
示例6: ociresult
</td>
<td>
<input type="text" name="txtdestino" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_DESTINO");
?>
'/>
</td>
<td>
<input type="text" name="txtdata" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "DT_MALOTE");
?>
'/>
</td>
<td>
<input type="text" name="txttipo" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_TIPO");
?>
'/>
</td>
<td>
<?php
echo "<a href='ConMalote.php?Atualizar&I={$id}' class='bt'>Atualizar</a>";
?>
</td>
<td>
<?php
echo "<a href='ConMalote.php?Excluir&I={$id}' class='bt'>Excluir</a>";
?>
</td>
</tr>
<?php
示例7: otherdb
//.........这里部分代码省略.........
SID:<input type="text" name="orasid" value="{$orasid}" style="width:50px"><br>
<script language="javascript">
function oraFull(i){
Str = new Array(5);
\tStr[0] = "";
\tStr[1] = "select version();";
\tStr[2] = "SELECT NAME FROM V{$DATABASE}";
\tStr[3] = "select * From all_objects where object_type='TABLE'";
\tStr[4] = "select column_name from user_tab_columns where table_name='table1'";
\toraform.orasql.value = Str[i];
\treturn true;
}
</script>
<textarea name="orasql" style="width:600px;height:200px;">{$oraquery}</textarea><br>
<select onchange="return oraFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">��ʾ�汾</option>
\t<option value="2">���ݿ�</option>
\t<option value="3">����</option>
\t<option value="4">�ֶ�</option>
</select>
<input type="hidden" name="action" value="myquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
if ($oraaction == 'oraquery') {
$oralink = OCILogon($orauser, $orapass, "(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST={$orahost})(PORT = {$oraport}))(CONNECT_DATA =(SID={$orasid})))") or die(ocierror());
$oraresult = ociparse($oralink, $oraquery) or die(ocierror());
$orarow = oci_fetch_row($oraresult);
echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
for ($i = 0; $i < oci_num_fields($oraresult); $i++) {
echo '<td><b>' . oci_field_name($oraresult, $i) . "</b></td>\n";
}
echo "</tr>\n";
ociresult($oraresult, 0);
while ($orarow = ora_fetch_row($oraresult)) {
echo "<tr>\n";
for ($i = 0; $i < ora_num_fields($result); $i++) {
echo '<td>' . "{$orarow[$i]}" . '</td>';
}
echo "</tr>\n";
}
echo "</table></font>";
oci_free_statement($oraresult);
ocilogoff();
}
} elseif ($db == "ifx") {
$ifxuser = isset($_POST['ifxuser']) ? $_POST['ifxuser'] : 'root';
$ifxpass = isset($_POST['ifxpass']) ? $_POST['ifxpass'] : '123456';
$ifxdbname = isset($_POST['ifxdbname']) ? $_POST['ifxdbname'] : 'ifxdb';
$ifxaction = isset($_POST['action']) ? $_POST['action'] : '';
$ifxquery = isset($_POST['ifxsql']) ? $_POST['ifxsql'] : '';
$ifxquery = stripslashes($ifxquery);
print <<<END
<form method="POST" name="ifxform" action="?s=gg&db=ifx">
<div class="actall">Dbname:<input type="text" name="ifxhost" value="{$ifxdbname}" style="width:100px">
User:<input type="text" name="ifxuser" value="{$ifxuser}" style="width:100px">
Pass:<input type="text" name="ifxpass" value="{$ifxpass}" style="width:100px"><br>
<script language="javascript">
function ifxFull(i){
Str = new Array(11);
\tStr[0] = "";
\tStr[1] = "select dbservername from sysobjects;";
\tStr[2] = "select name from sysdatabases;";
\tStr[3] = "select tabname from systables;";
\tStr[4] = "select colname from syscolumns where tabid=n;";
\tStr[5] = "select username,usertype,password from sysusers;";
示例8: getStudyInfo
/**
* Get information about student's programms and subjects.
*
* @param $sident
*
* @return array
*/
public function getStudyInfo($sident)
{
$query = "SELECT zpovinn, pnazev, panazev, zvysl, zbody, to_char(zdatum,'DD.MM.YYYY')\n\t\t\t\t\tAS datum, zskr\n\t\t\t\t\tFROM zkous JOIN ( SELECT povinn,pnazev,panazev,vplatiod,vplatido\n\t\t\t\t\tFROM povinn UNION SELECT povinn,pnazev,panazev,vplatiod,vplatido\n\t\t\t\t\tFROM povinn2 ) ON (zpovinn=povinn AND vplatiod<=zskr AND vplatido>=zskr )\n\t\t\t\t\tWHERE zsplsem='S' AND zident = {$sident} ORDER BY zskr, zdt";
$data = $this->execute($query);
$grades = [];
while (ocifetch($data)) {
$grades[] = ['code' => ociresult($data, "ZPOVINN"), 'name' => ociresult($data, "PNAZEV"), 'name_en' => ociresult($data, "PANAZEV"), 'grade' => ociresult($data, "ZVYSL"), 'credits' => ociresult($data, "ZBODY"), 'date' => ociresult($data, "DATUM"), 'year' => ociresult($data, "ZSKR")];
}
return $grades;
}
示例9: oci_bind_by_name
oci_bind_by_name($sql, ':protocolo', $cprotocolo);
oci_bind_by_name($sql, ':usuario', $cusuario);
oci_execute($sql);
oci_free_statement($sql);
echo "<script>alert('Dados cadastrado com sucesso.'); window.location='ConCorrespondencia.php'</script>";
}
if ($_POST['Inserir'] == "MALOTE") {
$malote = $_POST['txtnumero'];
$origem = $_POST['txtorigem'];
$destino = $_POST['txtdestino'];
$data = $_POST['txtdata'];
$servico = $_POST['txtservico'];
$sql_ = oci_parse($conexao, "SELECT cd_servico FROM Servico WHERE nm_tipo = '" . $servico . "'");
oci_execute($sql_, OCI_DEFAULT);
while (Ocifetch($sql_)) {
$cservico = ociresult($sql_, "CD_SERVICO");
}
oci_free_statement($sql_);
$sql = oci_parse($conexao, 'INSERT INTO Malote (cd_malote, nm_origem, nm_destino, dt_malote, cd_servico) VALUES (:malote, :origem, :destino, :data, :servico)');
oci_bind_by_name($sql, ':malote', $malote);
oci_bind_by_name($sql, ':origem', $origem);
oci_bind_by_name($sql, ':destino', $destino);
oci_bind_by_name($sql, ':data', $data);
oci_bind_by_name($sql, ':servico', $cservico);
oci_execute($sql);
oci_free_statement($sql);
echo "<script>alert('Dados cadastrado com sucesso.'); window.location='ConMalote.php'</script>";
}
if ($_POST['Inserir'] == "PROTOCOLO") {
$sql = oci_parse($conexao, 'INSERT INTO Protocolo (cd_protocolo, dt_recebimento) VALUES (:protocolo, :data)');
$cprotocolo = $_POST['txtnumero'];
示例10: form_checkfield
function form_checkfield($name, $title, $sql)
{
$stm = ociexec($sql);
echo "<tr><td align=right>{$title} :</td><td>";
while (ocifetch($stm)) {
echo "<input type=checkbox name={$name} value=\"" . ociresult($stm, 'CVALUE') . "\">" . ociresult($stm, 'CNAME') . "<br>";
}
echo "</td></tr>";
}
示例11: ocilogon
</div>
<?php
$username = $_POST['username'];
$password = $_POST['pwd'];
$connection = ocilogon("tanis2", "oracle", "oracle.uis.edu");
$sqlquery = "SELECT count(*) FROM CREDENTIALS WHERE username='" . $username . "' AND password='" . $password . "'";
$sql_id = ociparse($connection, $sqlquery);
if (!$sql_id) {
$e = oci_error($connection);
echo "The following error occured:";
print htmlentities($e['message']);
exit;
}
ociexecute($sql_id, OCI_DEFAULT);
while (ocifetch($sql_id)) {
$result = ociresult($sql_id, 1);
if ($result == 1) {
echo "<h3>You have logged in successfully<h3/>";
echo "<a href='http://uisacad.uis.edu/~kmulpu2/criteriaForReport.html'>Click here to generate reports</a>";
} else {
echo '<font color="' . red . '">Invalid login credentials. Please enter correct username and password</font>';
echo "<br/><br/>";
echo "<a href='http://uisacad.uis.edu/~kmulpu2/DillardsReporting.html'>Back To Login Page</a>";
}
}
ocicommit($connection);
OCIFreeStatement($sql_id);
ocilogoff($connection);
?>
</body>
</html>
示例12: db_get_query_rows
/**
* Get the rows returned from a SELECT query.
*
* @param resource The query result pointer
* @param ?integer Whether to start reading from (NULL: irrelevant for this forum driver)
* @return array A list of row maps
*/
function db_get_query_rows($stmt, $start = NULL)
{
$out = array();
$i = 0;
$num_fields = ocinumcols($stmt);
$types = array();
$names = array();
for ($x = 1; $x <= $num_fields; $x++) {
$types[$x] = ocicolumntype($stmt, $x);
$names[$x] = strtolower(ocicolumnname($stmt, $x));
}
while (ocifetch($stmt)) {
if (is_null($start) || $i >= $start) {
$newrow = array();
for ($j = 1; $j <= $num_fields; $j++) {
$v = ociresult($stmt, $j);
if (is_object($v)) {
$v = $v->load();
}
// For CLOB's
if ($v === false) {
fatal_exit(do_lang_tempcode('QUERY_FAILED', ocierror($stmt)));
}
$name = $names[$j];
$type = $types[$j];
if ($type == 'NUMBER') {
if (!is_null($v)) {
$newrow[$name] = intval($v);
} else {
$newrow[$name] = NULL;
}
} else {
if ($v == ' ') {
$v = '';
}
$newrow[$name] = $v;
}
}
$out[] = $newrow;
}
$i++;
}
return $out;
}
示例13: ociresult
</td>
<td>
<input type="text" name="txtusuario" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_USUARIO");
?>
'/>
</td>
<td>
<input type="password" name="txtsenha" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_SENHA");
?>
'/>
</td>
<td>
<input type="text" name="txtacesso" class="txt" readonly="readonly" value='<?php
echo ociresult($stmt, "NM_ACESSO");
?>
'/>
</td>
<td>
<?php
echo "<a href='ConUsuario.php?Atualizar&I={$id}' class='bt'>Atualizar</a>";
?>
</td>
<td>
<?php
echo "<a href='ConUsuario.php?Excluir&I={$id}' class='bt'>Excluir</a>";
?>
</td>
</tr>
<?php
示例14: ociparse
echo "Couldn't make a connection!";
exit;
} else {
echo "You have connected to the UIS Oracle Database!! <p>";
}
$sqlquery = "SELECT CustomerID FROM CUSTOMER WHERE LastName='" . $_SESSION["newCustomerLastName"] . "' AND FirstName='" . $_SESSION["newCustomerFirstName"] . "' AND Email='" . $_SESSION["newCustomerEmail"] . "'";
$sql_id = ociparse($connection, $sqlquery);
if (!$sql_id) {
$e = oci_error($connection);
print htmlentities($e['message']);
exit;
}
ociexecute($sql_id, OCI_DEFAULT);
echo "Customer ID =";
while (oci_fetch($sql_id)) {
echo ociresult($sql_id, 1);
}
$sqlquery1 = "SELECT * FROM TRANS WHERE CustomerID IN(SELECT CustomerID FROM CUSTOMER WHERE LastName='" . $_SESSION["newCustomerLastName"] . "' AND FirstName='" . $_SESSION["newCustomerFirstName"] . "' AND Email='" . $_SESSION["newCustomerEmail"] . "')";
$sql_id1 = ociparse($connection, $sqlquery1);
if (!$sql_id1) {
$e = oci_error($connection);
print htmlentities($e['message']);
exit;
}
ociexecute($sql_id1, OCI_DEFAULT);
echo "<h3>Transaction Details of the Customer</h3>";
echo "<table>";
echo "<tr><td>" . TransactionID . "</td><td></td><td>" . DateAcquired . "</td><td></td><td>" . AcquisitionPrice . "</td><td></td><td>" . DateSold . "</td><td></td><td>" . AskingPrice . "</td><td></td><td>" . SalesPrice . "</td><td></td><td>" . CustomerID . "</td><td></td><td>" . WorkID . "</td></tr>";
while ($row = OCI_Fetch_Array($sql_id1, OCI_NUM)) {
echo "<tr><td>" . $row[0] . "</td><td></td><td>" . $row[1] . "</td><td></td><td>" . $row[2] . "</td><td></td><td>" . $row[3] . "</td><td></td><td>" . $row[4] . "</td><td></td><td>" . $row[5] . "</td><td></td><td>" . $row[6] . "</td><td></td><td>" . $row[7] . "</td></tr>";
}
示例15: 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 ($this->Error["code"] == 2289) {
$Query_ID = ociparse($this->Link_ID, "CREATE SEQUENCE {$seqname}");
if (!ociexecute($Query_ID)) {
$this->Error = OCIError($Query_ID);
$this->Errors->addError("Database error: " . $this->Error["message"]);
return 0;
} 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;
}