本文整理匯總了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));
}