當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XDB::rawFetchColumn方法代碼示例

本文整理匯總了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) {
開發者ID:Ekleog,項目名稱:platal,代碼行數:31,代碼來源:merge_issues.php

示例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;
 }
開發者ID:Ekleog,項目名稱:platal,代碼行數:17,代碼來源:userfilter.php


注:本文中的XDB::rawFetchColumn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。