【发布时间】:2015-03-09 10:44:34
【问题描述】:
我想避免在我的代码中使用 distinct()。我需要一些帮助来创建一个表,该表将保留从 db 表看门狗中获取的值并检查是否已获取下一个值。如果下一个值在表中,则该值将不会插入表中...我需要真正的帮助,因为如果我解决了这个问题,我将结束我的模块。提前致谢!!
// Begin building the query.
$query = db_select('watchdog', 'th')
->extend('PagerDefault')
->orderBy('wid')
->distinct()
->fields('th', array('variables', 'type', 'severity', 'message', 'wid'))
->limit(2000);
// Fetch the result set.
$result = $query -> execute();
// Loop through each item and add to $row.
foreach ($result as $row) {
blablablabla($row);
}
}
我想要变量列的不同值。我不想要一个主题表,我只想要一个包含一些值的表。
【问题讨论】:
标签: mysql database drupal drupal-7