本文整理汇总了PHP中ADODB_oci8::Prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_oci8::Prepare方法的具体用法?PHP ADODB_oci8::Prepare怎么用?PHP ADODB_oci8::Prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB_oci8
的用法示例。
在下文中一共展示了ADODB_oci8::Prepare方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Prepare
function Prepare($sql, $cursor = false)
{
$sqlarr = explode('?', $sql);
$sql = $sqlarr[0];
for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) {
$sql .= ':' . ($i - 1) . $sqlarr[$i];
}
return ADODB_oci8::Prepare($sql, $cursor);
}
示例2: ExecuteCursor
function ExecuteCursor($sql,$cursorName='rs',$params=false)
{
if (is_array($sql)) $stmt = $sql;
else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor
if (is_array($stmt) && sizeof($stmt) >= 5) {
$hasref = true;
$ignoreCur = false;
$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
if ($params) {
foreach($params as $k => $v) {
$this->Parameter($stmt,$params[$k], $k);
}
}
} else
$hasref = false;
$rs = $this->Execute($stmt);
if ($rs) {
if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
elseif ($hasref) $rs->_refcursor = $stmt[4];
}
return $rs;
}
示例3: foreach
function &ExecuteCursor($sql, $cursorName = 'rs', $params = false)
{
$stmt = ADODB_oci8::Prepare($sql, true);
# true to allocate OCINewCursor
if (is_array($stmt) && sizeof($stmt) >= 5) {
$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
if ($params) {
foreach ($params as $k => $v) {
$this->Parameter($stmt, $params[$k], $k);
}
}
}
return $this->Execute($stmt);
}
示例4: reset
function &ExecuteCursor($sql, $cursorName = 'rs', $params = false)
{
$stmt = ADODB_oci8::Prepare($sql);
if (is_array($stmt) && sizeof($stmt) >= 5) {
$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
if ($params) {
reset($params);
while (list($k, $v) = each($params)) {
$this->Parameter($stmt, $params[$k], $k);
}
}
}
return $this->Execute($stmt);
}
示例5: foreach
function &ExecuteServicior($sql, $serviciorName = 'rs', $params = false)
{
if (is_array($sql)) {
$stmt = $sql;
} else {
$stmt = ADODB_oci8::Prepare($sql, true);
}
# true to allocate OCINewServicior
if (is_array($stmt) && sizeof($stmt) >= 5) {
$hasref = true;
$this->Parameter($stmt, $ignoreCur, $serviciorName, false, -1, OCI_B_SERVICIOR);
if ($params) {
foreach ($params as $k => $v) {
$this->Parameter($stmt, $params[$k], $k);
}
}
} else {
$hasref = false;
}
$rs =& $this->Execute($stmt);
if ($rs) {
if ($rs->databaseType == 'array') {
OCIFreeServicior($stmt[4]);
} else {
if ($hasref) {
$rs->_refservicior = $stmt[4];
}
}
}
return $rs;
}
示例6:
function &ExecuteCursor($sql, $cursorName = 'rs')
{
$stmt = ADODB_oci8::Prepare($sql);
if (is_array($stmt) && sizeof($stmt) >= 5) {
$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
}
return $this->Execute($stmt);
}