本文整理汇总了PHP中oci_execute函数的典型用法代码示例。如果您正苦于以下问题:PHP oci_execute函数的具体用法?PHP oci_execute怎么用?PHP oci_execute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了oci_execute函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sql_query
function sql_query($sqltype, $query, $con)
{
if ($sqltype == 'mysql') {
if (class_exists('mysqli')) {
return $con->query($query);
} elseif (function_exists('mysql_query')) {
return mysql_query($query);
}
} elseif ($sqltype == 'mssql') {
if (function_exists('sqlsrv_query')) {
return sqlsrv_query($con, $query);
} elseif (function_exists('mssql_query')) {
return mssql_query($query);
}
} elseif ($sqltype == 'pgsql') {
return pg_query($query);
} elseif ($sqltype == 'oracle') {
return oci_execute(oci_parse($con, $query));
} elseif ($sqltype == 'sqlite3') {
return $con->query($query);
} elseif ($sqltype == 'sqlite') {
return sqlite_query($con, $query);
} elseif ($sqltype == 'odbc') {
return odbc_exec($con, $query);
} elseif ($sqltype == 'pdo') {
return $con->query($query);
}
}
开发者ID:lionsoft,项目名称:b374k,代码行数:28,代码来源:database.php
示例2: readCursor
public function readCursor($storedProcedure, $binds)
{
//
// This function needs two parameters:
//
// $storedProcedure - the name of the stored procedure to call a chamar. Ex:
// my_schema.my_package.my_proc(:param)
//
// $binds - receives an array of associative arrays with: parameter names,
// values and sizes
//
// WARNING: The first parameter must be consistent with the second one
$conn = oci_connect('SECMAN', 'SECMAN', '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.10.24)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = cisqa)))');
if ($conn) {
// Create the statement and bind the variables (parameter, value, size)
$stid = oci_parse($conn, 'begin :cursor := ' . $storedProcedure . '; end;');
foreach ($binds as $variable) {
oci_bind_by_name($stid, $variable["parameter"], $variable["value"], $variable["size"]);
}
// Create the cursor and bind it
$p_cursor = oci_new_cursor($conn);
oci_bind_by_name($stid, ':cursor', $p_cursor, -1, OCI_B_CURSOR);
// Execute the Statement and fetch the data
oci_execute($stid);
oci_execute($p_cursor, OCI_DEFAULT);
oci_fetch_all($p_cursor, $data, null, null, OCI_FETCHSTATEMENT_BY_ROW);
// Return the data
return $data;
}
}
开发者ID:fajarnugrohoid,项目名称:nontaglis,代码行数:30,代码来源:OracleModel.php
示例3: insertImage
function insertImage($conn, $photo_id, $owner_name, $descriptive_info, $thumbnail, $photo)
{
$photo_blob = oci_new_descriptor($conn, OCI_D_LOB);
$thumbnail_blob = oci_new_descriptor($conn, OCI_D_LOB);
$subject = $descriptive_info[0];
$place = $descriptive_info[1];
$date_time = $descriptive_info[2];
$description = $descriptive_info[3];
$permitted = $descriptive_info[4];
$sql = 'INSERT INTO images (photo_id, owner_name, permitted, subject, place,
timing, description, thumbnail, photo) VALUES (:photoid, :ownername,
:permitted, :subject, :place, TO_DATE(:datetime, \'MM/DD/YYYY\'), :description, empty_blob(),
empty_blob()) returning thumbnail, photo into :thumbnail, :photo';
$stid = oci_parse($conn, $sql);
oci_bind_by_name($stid, ':photoid', $photo_id);
oci_bind_by_name($stid, ':ownername', $owner_name);
oci_bind_by_name($stid, ':permitted', $permitted);
oci_bind_by_name($stid, ':subject', $subject);
oci_bind_by_name($stid, ':place', $place);
oci_bind_by_name($stid, ':datetime', $date_time);
oci_bind_by_name($stid, ':description', $description);
oci_bind_by_name($stid, ':thumbnail', $thumbnail_blob, -1, OCI_B_BLOB);
oci_bind_by_name($stid, ':photo', $photo_blob, -1, OCI_B_BLOB);
$res = oci_execute($stid, OCI_DEFAULT);
if ($thumbnail_blob->save($thumbnail) && $photo_blob->save($photo)) {
oci_commit($conn);
} else {
oci_rollback($conn);
}
oci_free_statement($stid);
$photo_blob->free();
$thumbnail_blob->free();
}
开发者ID:ismailmare,项目名称:Photoshare,代码行数:33,代码来源:uploadDB.php
示例4: _execute
protected function _execute($sql)
{
$this->stmt_id = FALSE;
$this->_set_stmt_id($sql);
oci_set_prefetch($this->stmt_id, 1000);
return @oci_execute($this->stmt_id, $this->_commit);
}
开发者ID:pepegarcia,项目名称:publicidadoficialdemo-1,代码行数:7,代码来源:oci8_driver.php
示例5: get_list
function get_list($data)
{
$results = array();
$games = array();
$conn = oci_connect('malz', '1Qaz2wsx', '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=db1.chpc.ndsu.nodak.edu)(Port=1521)))(CONNECT_DATA=(SID=cs)))');
//Select customer with last name from field
$userQuery = 'select userName from Account where listId = :data';
$listQuery = 'select * from ListGame, Game where listId = :data and ListGame.gameId = Game.gameId';
$stid = oci_parse($conn, $userQuery);
$stid2 = oci_parse($conn, $listQuery);
oci_bind_by_name($stid, ':data', $data);
oci_bind_by_name($stid2, ':data', $data);
oci_execute($stid, OCI_DEFAULT);
//iterate through each row
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
$results[] = $row;
}
oci_execute($stid2, OCI_DEFAULT);
while ($row = oci_fetch_array($stid2, OCI_ASSOC)) {
$games[] = $row;
}
$results[] = $games;
echo json_encode($results);
oci_free_statement($stid);
oci_free_statement($stid2);
oci_close($conn);
}
开发者ID:GabieJay,项目名称:CatBoard,代码行数:27,代码来源:List.php
示例6: obtain_roadnet_xml_all
function obtain_roadnet_xml_all()
{
$sql = "select * from node_info";
$r = oci_parse($dbconn, $query);
oci_execute($r, OCI_DEFAULT);
return get_Roadnet_xml($r);
}
开发者ID:newmight2015,项目名称:hztfpf,代码行数:7,代码来源:obtain_roadnet_xml.php
示例7: crearActividad
public function crearActividad($actividad)
{
session_start();
$sqltxt = "insert into s_actividad values(14,'" . $actividad->getNombre_actividad() . "','" . $actividad->getDescripcion() . "')";
$stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
oci_execute($stid);
}
开发者ID:salcedogeiner,项目名称:Alimentario,代码行数:7,代码来源:ActividadDAO.php
示例8: get_filteredGames
function get_filteredGames($data)
{
// The connection string is loooooooong. It's easiest to copy/paste this line. Remember to replace 'username' and 'password'!
$conn = oci_connect('malz', '1Qaz2wsx', '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=db1.chpc.ndsu.nodak.edu)(Port=1521)))(CONNECT_DATA=(SID=cs)))');
if ($data === 'all') {
$results = array();
$query = 'select * from Game';
$stid = oci_parse($conn, $query);
oci_bind_by_name($stid, ':data', $data);
oci_execute($stid);
//iterate through each row
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
$results[] = $row;
}
echo json_encode($results);
oci_free_statement($stid);
oci_close($conn);
} else {
$results = array();
$data = $data . '%';
$query = 'select * from Game where gameName like :data';
$stid = oci_parse($conn, $query);
oci_bind_by_name($stid, ':data', $data);
oci_execute($stid);
//iterate through each row
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
$results[] = $row;
}
echo json_encode($results);
oci_free_statement($stid);
oci_close($conn);
}
}
开发者ID:GabieJay,项目名称:CatBoard,代码行数:33,代码来源:Search.php
示例9: afficher_produit
function afficher_produit($is_fruit)
{
if ($is_fruit) {
$requete = "SELECT * FROM Produits WHERE `fruit`=1";
} else {
$requete = "SELECT * FROM Produits WHERE `fruit`=0";
}
$idcom = connex("Myparam");
$stmt = oci_parse($idcom, $requete);
$result = oci_execute($result, OCI_DEFAULT);
if (!$result) {
echo "Lecture impossible";
} else {
echo "<table cellspacing='0' cellpadding='5'>";
echo "<tr>";
echo "<th>Produit</th><th>Description</th><th>Stock</th><th>Prix</th><th>Quantité</th><th></th>";
echo "</tr>";
while ($ligne = oci_fetch_assoc($result)) {
echo "<tr id='" . $ligne[0] . "'>";
echo "<td>" . $ligne[1] . "</td>";
echo "<td>" . $ligne[2] . "</td>";
echo "<td>" . $ligne[3] . "</td>";
echo "<td>" . $ligne[4] . "</td>";
echo "<td><select name='qte_v[]'>";
for ($i = 1; $i <= $ligne[3]; $i++) {
echo "<option>" . $i . "</option>";
}
echo "</select></td>";
echo '<td><button onclick="addProduit($(this));" class=bouton_produit>Ajouter au panier</button></td>';
echo "</tr>";
}
echo "</table>";
}
}
开发者ID:Athox,项目名称:Projet-PHP-Vente-Bio,代码行数:34,代码来源:produit.php
示例10: cargarArray
function cargarArray($sentencia)
{
include dirname(__FILE__) . '/conectar_ORACLE.php';
$array = array();
$sentenciaExec = oci_parse($c, $sentencia);
oci_execute($sentenciaExec);
$error = 0;
$k = 0;
$ncols = oci_num_fields($sentenciaExec);
for ($i = 1; $i <= $ncols; ++$i) {
$colname = oci_field_name($sentenciaExec, $i);
$array[0][$k] = $colname;
$k++;
}
$cont = 0;
$j = 1;
$k = 0;
while ($row = oci_fetch_array($sentenciaExec, OCI_BOTH + OCI_RETURN_NULLS)) {
while ($cont < $ncols) {
$array[$j][$cont] = $row[$cont];
$cont++;
}
$cont = 0;
$k = 0;
$j++;
}
if (oci_num_rows($sentenciaExec) == 0) {
oci_free_statement($sentenciaExec);
return false;
} else {
oci_free_statement($sentenciaExec);
return $array;
}
}
开发者ID:ezeed,项目名称:CPI,代码行数:34,代码来源:functions.php
示例11: asignarDiaSolicitud
public function asignarDiaSolicitud($iddia, $idsolicitud)
{
$dia = new DiaSolicitud();
$sqltxt = "insert into s_diasolicitud values(" . $idsolicitud . "," . $iddia . ")";
$stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
oci_execute($stid);
}
开发者ID:blacburn,项目名称:ApoyoAlimentario,代码行数:7,代码来源:DiaSolicitudDAO.php
示例12: dispCart
function dispCart()
{
$cartLen = count($_SESSION['cart']);
if ($cartLen < 1) {
echo 'You have no items in your cart.<br><a href="main.php">Keep shopping</a><br>';
die;
}
//for loop to iterate through cart items
for ($i = 0; $i < $cartLen; $i++) {
if ($cartLen > 0) {
$newconn = conndb();
//sql
$s = oci_parse($newconn, "select * from PRODUCT where PRODUCTID=:pid_prefix");
$plook = $_SESSION['cart'][$i]['productid'];
oci_bind_by_name($s, ':pid_prefix', $plook);
oci_execute($s);
//fetch a single row depending on product id
$res = oci_fetch_assoc($s);
echo "Product name: ", $res['PRODUCTNAME'], " Price: ", $res['PRODUCTPRICE'];
echo '<a href="cart.php?del=' . $i . '"> Remove item</a><br>';
}
}
if ($cartLen > 0) {
echo '<a href="checkout.php">Proceed to checkout</a><br>';
}
}
开发者ID:Emadbox,项目名称:eStore,代码行数:26,代码来源:cart.php
示例13: consultar
public function consultar()
{
//$prub = Conexion::getInstancia("system", "admin");
//$p=new Persona();
$persina = new PersonaDAO();
$aa = new ConexionDB("apoyo_alimentario", "apoyo_alimentario");
if ($aa->conectarDB()) {
$sesion = $aa->getConn();
$facultades = array();
$i = 0;
$sqltxt = "select * from facultad";
$stid = oci_parse($sesion, $sqltxt);
oci_execute($stid);
while (oci_fetch($stid)) {
$facultad = new Facultad();
$facultad->setIdfacultad(oci_result($stid, 'ID_FACULTAD'));
$facultad->setNombre_facultad(oci_result($stid, 'NOMBRE_FACULTAD'));
$facultades[$i] = $facultad;
$i += 1;
}
return $facultades;
//oci_parse($a, $sql_text);
//echo $a;
}
}
开发者ID:salcedogeiner,项目名称:Alimentario,代码行数:25,代码来源:ConsultasAux.php
示例14: getUserObjectData
public function getUserObjectData()
{
$sql = "SELECT object_name, object_type, TO_CHAR(created, 'DD/MM/YYYY') AS created, TO_CHAR(last_ddl_time, 'DD/MM/YYYY') AS last_ddl_time, status FROM user_objects WHERE object_name = UPPER(:v_obj_name) AND object_type = UPPER(:v_obj_type)";
$stmt = oci_parse($this->getConnection(), $sql);
oci_bind_by_name($stmt, ":v_obj_name", $this->objectName);
oci_bind_by_name($stmt, ":v_obj_type", $this->objectType);
if (!@oci_execute($stmt)) {
$e = oci_error($stmt);
$this->setMensaje("Error al obtener los datos del objeto '{$this->objectName}' de la tabla user_objects - {$e['message']}");
return false;
}
$row = @oci_fetch_array($stmt, OCI_ASSOC | OCI_RETURN_NULLS);
if (empty($row)) {
$this->setMensaje("No se pudo encontrar el objeto '{$this->objectName}' en la tabla user_objects");
return false;
}
$this->fechaCreacion = $row['CREATED'];
$this->fechaModificacion = $row['LAST_DDL_TIME'];
$this->oracleStatus = $row['STATUS'];
if ($this->oracleStatus != 'VALID') {
$this->setMensaje("El objeto '{$this->objectName}' tiene el estado '{$this->oracleStatus}' en la tabla user_objects");
return false;
}
return true;
}
开发者ID:juyagu,项目名称:Analia,代码行数:25,代码来源:UserObject.php
示例15: execute
public function execute($mode = OCI_COMMIT_ON_SUCCESS)
{
set_error_handler(static::getErrorHandler());
$isSuccess = oci_execute($this->resource, $mode);
restore_error_handler();
return $isSuccess;
}
开发者ID:jpina,项目名称:oci8,代码行数:7,代码来源:Oci8Statement.php
示例16: fetchAndUpdateFacultyInfo
function fetchAndUpdateFacultyInfo($query, $conn, $nextPage)
{
$stid = oci_parse($conn, $query);
var_dump($query);
oci_execute($stid);
echo "<form action=\"{$nextPage}?user=FACULTY\">";
echo "<table border='1'>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
$i = 1;
foreach ($row as $item) {
echo "<tr>\n";
$column_name = oci_field_name($stid, $i);
echo "<td> {$column_name} </td>\n";
if ($column_name == "UnityId" || $column_name == "FacultyNo" || $column_name == "Balance" || $column_name == "Type" || $column_name == "Category" || $column_name == "isHeld" || $column_name == "Department") {
echo " <td>" . "<input type=\"text\" name=\"{$column_name}\" value=\"{$item}\" readonly>" . "</td>\n";
} else {
echo " <td>" . "<input type=\"text\" name=\"{$column_name}\" value=\"{$item}\" >" . "</td>\n";
}
$i++;
echo "</tr>\n";
}
}
echo "</table>\n";
echo "<input type=\"submit\" value=\"Update\">";
echo "</form>";
}
开发者ID:anbarasimanoharan,项目名称:Library-Management-System,代码行数:26,代码来源:UpdateFacultyInfoUtils.php
示例17: cargarArray
function cargarArray($FUPE_CD_PROMOTOR, $FUPE_FE_ESTADO_DESDE, $FUPE_FE_ESTADO_HASTA, $queries)
{
include dirname(__FILE__) . '/conectar_ORACLE.php';
//echo $queries.";<br /><br />";
$array = array();
$query = oci_parse($c, $queries);
oci_execute($query);
$error = 0;
$ncols = oci_num_fields($query);
$cont = 0;
$j = 0;
$k = 0;
while ($row = oci_fetch_array($query, OCI_BOTH + OCI_RETURN_NULLS)) {
while ($cont < $ncols) {
$array[$j][$cont] = $row[$cont];
$cont++;
}
$cont = 0;
$k = 0;
$j++;
}
if (oci_num_rows($query) == 0) {
return false;
} else {
return $array;
}
}
开发者ID:erosennin93,项目名称:CPI,代码行数:27,代码来源:totalesVendedorAM_datos.php
示例18: buscarPorProcedimiento
public function buscarPorProcedimiento()
{
$sql = "SELECT job, to_char(last_date, 'DD/MM/YYYY') last_date, last_sec, to_char(next_date, 'DD/MM/YYYY') next_date, next_sec, interval, failures, what from user_jobs WHERE UPPER(what) LIKE UPPER('%' || :v_procedure_name || '%')";
$stmt = oci_parse($this->getConnection(), $sql);
oci_bind_by_name($stmt, ":v_procedure_name", $this->objectName);
if (!@oci_execute($stmt)) {
$e = oci_error($stmt);
$this->setMensaje("Error al obtener los datos del job que ejecuta el proceso '{$this->objectName}' de la tabla user_jobs - {$e['message']}");
$this->setEstado(false);
}
$row = oci_fetch_array($stmt, OCI_ASSOC | OCI_RETURN_NULLS);
if (empty($row)) {
$this->setEstado(false);
}
$this->jobId = $row['JOB'];
$this->lastDate = $row['LAST_DATE'];
$this->lastSec = $row['LAST_SEC'];
$this->nextDate = $row['NEXT_DATE'];
$this->nextSec = $row['NEXT_SEC'];
$this->interval = $row['INTERVAL'];
$this->failures = $row['FAILURES'];
$this->jobSql = $row['WHAT'];
$this->setEstado(true);
return $this->getEstado();
}
开发者ID:juyagu,项目名称:Analia,代码行数:25,代码来源:Job.php
示例19: 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;
}
}
开发者ID:Emadbox,项目名称:eStore,代码行数:26,代码来源:login.php
示例20: _query
public function _query($sql)
{
$this->stid = oci_parse($this->link, $sql);
if ($this->stid != false) {
// parsing empty query != false
if (oci_execute($this->stid)) {
return $this->stid;
// executing empty query != false
/*
if (oci_fetch_all($this->stid, $data, 0, -1, OCI_FETCHSTATEMENT_BY_ROW) == false) {
// but fetching executed empty query results in error (ORA-24338: statement handle not executed)
$e = oci_error($this->stid);
echo $e['message'];
} */
} else {
$e = oci_error($this->stid);
echo $e['message'];
return false;
}
} else {
$e = oci_error($this->link);
echo $e['message'];
return false;
}
//$stid = oci_parse();
//oci_execute($stid);
return $this->stid;
}
开发者ID:glial,项目名称:glial,代码行数:28,代码来源:Oracle.php
注:本文中的oci_execute函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论