本文整理汇总了PHP中XDB::rawFetchColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP XDB::rawFetchColumn方法的具体用法?PHP XDB::rawFetchColumn怎么用?PHP XDB::rawFetchColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDB
的用法示例。
在下文中一共展示了XDB::rawFetchColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
$j = 0;
while ($item = $it->next()) {
$phone = new Phone($item);
$phone->delete();
$phone->save();
++$i;
++$j;
if ($j == 100) {
$j = 0;
printf("\r%u / %u", $i, $total);
}
}
printf("\r%u / %u", $i, $total);
print "\nFormating done.\n\n";
print "Deletes duplicated phones. (4/4)\n";
$pids = XDB::rawFetchColumn("SELECT DISTINCT(pid)\n FROM profile_phones AS p1\n WHERE link_type = 'user' AND EXISTS (SELECT *\n FROM profile_phones AS p2\n WHERE p2.link_type = 'user' AND p2.pid = p1.pid AND p2.tel_id != p1.tel_id)\n ORDER BY pid");
$total = count($pids);
$done = 0;
$aux = 0;
$deleted = 0;
$phones = array();
$duplicates = array();
foreach ($pids as $pid) {
$count = 0;
$it = Phone::iterate(array($pid), array(Phone::LINK_PROFILE), array(0), Visibility::get(Visibility::VIEW_PRIVATE));
while ($item = $it->next()) {
$phones[] = $item;
++$count;
}
for ($i = 0; $i < $count; ++$i) {
for ($j = $i + 1; $j < $count; ++$j) {
示例2: getPIDList
private function getPIDList($pids = null, PlLimit $limit)
{
$this->requireProfiles();
$this->buildQuery();
$lim = $limit->getSql();
$cond = '';
if (!is_null($pids)) {
$cond = XDB::format(' AND p.pid IN {?}', $pids);
}
$fetched = XDB::rawFetchColumn('SELECT SQL_CALC_FOUND_ROWS p.pid
' . $this->query . $cond . '
GROUP BY p.pid
' . $this->orderby . '
' . $lim);
$this->lastprofilecount = (int) XDB::fetchOneCell('SELECT FOUND_ROWS()');
return $fetched;
}