本文整理匯總了PHP中Definition::populateFromDbRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP Definition::populateFromDbRow方法的具體用法?PHP Definition::populateFromDbRow怎麽用?PHP Definition::populateFromDbRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Definition
的用法示例。
在下文中一共展示了Definition::populateFromDbRow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Definition
<?php
// Now that a Concept maps several Words to several Definitions, we
// can no longer use the first Word to compute the Lexicon field. We have to
// extract it from the definition.
require_once "../../phplib/util.php";
ini_set('max_execution_time', '3600');
$dbResult = mysql_query("select * from Definition");
$numRows = mysql_num_rows($dbResult);
$i = 0;
while ($dbRow = mysql_fetch_assoc($dbResult)) {
$def = new Definition();
$def->populateFromDbRow($dbRow);
$def->lexicon = text_extractLexicon($def);
// write a custom query so we don't update the ModDate field (also for speed)
mysql_query(sprintf("update Definition set Lexicon = '%s' where Id = '%s'", addslashes($def->lexicon), $def->id));
$i++;
if ($i % 1000 == 0) {
print "{$i}/{$numRows} definitions processed.\n";
}
}
mysql_free_result($dbResult);