本文整理汇总了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;
}