【发布时间】:2018-03-17 07:41:41
【问题描述】:
我在这里尝试连接三个表,以便我可以得到我想要的输出
Drupal 7 数据库选择
function abc($Incharge) {
$res= db_select('node', 'n')
->Join('aa', 'f', 'f.id = n.nid')
->Join('bb', 'd', 'd.id = f.entity_id');
return $total_res = $res ->condition('n.type', 'ram')
->condition('d.target_id',$Incharge)
->condition('n.status', 1)
->fields('n', array('nid', 'title'))
->orderBy('n.title', 'ASC')
->execute()->fetchAllKeyed();
}
但是我遇到了一个问题
致命错误:在字符串中调用成员函数 Join() /opt/lampp/htdocs/transgenic/sites/all/modules/report_system/report_system.module 在第 735 行
【问题讨论】:
标签: php mysql database drupal-7