我需要一个 MySQL 查询(标准 SQL)来从 drupal 7 获取文章信息(标题、图像、正文、发布日期)。仅最后一次修订。
最佳答案
听起来你想要一个 EntityFieldQuery
:
$query = new EntityFieldQuery;
$results = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'article')
->execute();
if (isset($results['node'])) {
$nodes = node_load_multiple(array_keys($results['node']));
foreach ($nodes as $node) {
$created = $node->created;
$image_uri = $node->field_image[$node->language][0]['uri'];
// ...
}
}
关于mysql - 在 drupal 7 中查询文章,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8492989/