【发布时间】:2023-03-04 18:52:01
【问题描述】:
我有一个自定义模块,安装后它会创建一个表,其中包含 blablabla 名称和 uid、时间戳作为字段。现在我真正想要的是当 cron 运行以从看门狗表中获取值(uid,时间戳)并将其传递给我的 blablabla 表时。有没有办法做这件事?这是我的代码:
**
* Implements hook_cron().
*/
function example_cron() {
// Begin building the query.
$query = db_select('watchdog', 'th')
->extend('PagerDefault')
->orderBy('wid')
->fields('th', array('uid', 'timestamp'))
->limit(2000);
// Fetch the result set.
$result = $query -> execute();
}
【问题讨论】:
标签: php mysql database drupal drupal-7