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


PHP Settings::queryAssoc方法代碼示例

本文整理匯總了PHP中nzedb\db\Settings::queryAssoc方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::queryAssoc方法的具體用法?PHP Settings::queryAssoc怎麽用?PHP Settings::queryAssoc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nzedb\db\Settings的用法示例。


在下文中一共展示了Settings::queryAssoc方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: time

$begintime = time();
echo "Creating new collections, binaries, and parts tables for each active group...\n";
foreach ($actgroups as $group) {
    if ($groups->createNewTPGTables($group['id']) === false) {
        exit($pdo->log->error("There is a problem creating new parts/files tables for group {$group['name']}."));
    }
    $consoletools->overWrite("Tables Created: " . $consoletools->percentString($gdone * 3, $newtables));
    $gdone++;
}
$endtime = time();
echo "\nTable creation took " . $consoletools->convertTime($endtime - $begintime) . ".\n";
$starttime = time();
echo "\nNew tables created, moving data from old tables to new tables.\nThis will take awhile....\n\n";
while ($cdone < $clen['total']) {
    // Only load 1000 collections per loop to not overload memory.
    $collections = $pdo->queryAssoc('select * from collections limit ' . $cdone . ',1000;');
    if ($collections instanceof \Traversable) {
        foreach ($collections as $collection) {
            $collection['subject'] = $pdo->escapeString($collection['subject']);
            $collection['fromname'] = $pdo->escapeString($collection['fromname']);
            $collection['date'] = $pdo->escapeString($collection['date']);
            $collection['collectionhash'] = $pdo->escapeString($collection['collectionhash']);
            $collection['dateadded'] = $pdo->escapeString($collection['dateadded']);
            $collection['xref'] = $pdo->escapeString($collection['xref']);
            $collection['releaseid'] = $pdo->escapeString($collection['releaseid']);
            $oldcid = array_shift($collection);
            if ($debug) {
                echo "\n\nCollection insert:\n";
                print_r($collection);
                echo sprintf("\nINSERT INTO collections_%d (subject, fromname, date, xref, totalfiles, group_id, collectionhash, dateadded, filecheck, filesize, releaseid) VALUES (%s)\n\n", $collection['group_id'], implode(', ', $collection));
            }
開發者ID:sebst3r,項目名稱:nZEDb,代碼行數:31,代碼來源:convert_to_tpg.php


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