本文整理匯總了PHP中ResultSet::setHolder方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultSet::setHolder方法的具體用法?PHP ResultSet::setHolder怎麽用?PHP ResultSet::setHolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ResultSet
的用法示例。
在下文中一共展示了ResultSet::setHolder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: query
function query($SQLCmd)
{
if (!$this->isConnect) {
return null;
}
$stmt = ociparse($this->connection, $SQLCmd);
ociexecute($stmt, OCI_DEFAULT);
$results = array();
oci_fetch_all($stmt, $results, 0, -1, OCI_FETCHSTATEMENT_BY_COLUMN);
$rs = new ResultSet();
$rs->setHolder($results);
oci_free_statement($stmt);
return $rs;
}
示例2: query
function query($SQLCmd)
{
if (!$this->isConnect) {
echo "not connected";
return new ResultSet();
}
$cursor = mysql_query($SQLCmd, $this->connection);
if (!$cursor) {
return new ResultSet();
}
$results = array();
$resultName = array();
for ($i = 0; $i < mysql_num_fields($cursor); $i++) {
$resultName[$i] = mysql_field_name($cursor, $i);
}
$cnt = 0;
while ($row = mysql_fetch_assoc($cursor)) {
for ($i = 0; $i < count($resultName); $i++) {
$results[$resultName[$i]][$cnt] = $row[$resultName[$i]];
}
$cnt++;
}
$rs = new ResultSet();
$rs->setHolder($results);
return $rs;
}
示例3: query
function query($SQLCmd)
{
if (!$this->isConnect) {
return null;
}
$cursor = ora_open($this->connection);
ora_parse($cursor, $SQLCmd);
ora_exec($cursor);
$results = array();
$resultName = array();
for ($i = 0; $i < ora_numcols($cursor); $i++) {
$resultName[$i] = ora_columnname($cursor, $i);
}
$cnt = 0;
while (ora_fetch($cursor)) {
for ($i = 0; $i < ora_numcols($cursor); $i++) {
$results[$resultName[$i]][$cnt] = ora_getcolumn($cursor, $i);
}
$cnt++;
}
$rs = new ResultSet();
$rs->setHolder($results);
ora_close($cursor);
return $rs;
}
示例4: query
function query($SQLCmd)
{
if (!$this->isConnect) {
return null;
}
$cursor = pg_query($this->connection, $SQLCmd);
$results = array();
$resultName = array();
for ($i = 0; $i < pg_num_fields($cursor); $i++) {
$resultName[$i] = pg_field_name($cursor, $i);
}
$cnt = 0;
while ($row = pg_fetch_assoc($cursor)) {
for ($i = 0; $i < count($resultName); $i++) {
$results[$resultName[$i]][$cnt] = $row[$resultName[$i]];
}
$cnt++;
}
$rs = new ResultSet();
$rs->setHolder($results);
return $rs;
}