Php 在NotORM中使用JOIN

Php 在NotORM中使用JOIN,php,sql,notorm,Php,Sql,Notorm,正在尝试以下代码 $notorm->table()->select("table.*, table2.column, table2.table3.column2"); from创建一个JOIN语句,但无效。我错过什么了吗 我有报告(时间戳、事件id、位置id)、事件(事件id、事件描述、位置id)和位置(位置id、位置名称)。我试图通过连接报告、事件和位置来获取时间戳、事件名称和位置名称。因此,我使用了以下语句: $notorm->reports()->select(

正在尝试以下代码

$notorm->table()->select("table.*, table2.column, table2.table3.column2"); 
from创建一个JOIN语句,但无效。我错过什么了吗

我有报告(时间戳、事件id、位置id)、事件(事件id、事件描述、位置id)和位置(位置id、位置名称)。我试图通过连接报告、事件和位置来获取时间戳、事件名称和位置名称。因此,我使用了以下语句:

$notorm->reports()->select("reports.*, incident.incident_id, incident.location.location_id");
但它什么也不退。但以下声明:

$notorm->reports()->select("reports.*");

返回报告。

试试这个,虽然不是100%确定,但值得一试

$notorm->reports()->join("reports", "LEFT JOIN incident ON reports.incident_id = incident.incident_id")
->join("reports", "LEFT JOIN location ON reports.location_id = location.location_id")
->select("reports.timestamp, incident.incident_desc, location.location_name"); 

在您的
定义中,必须有一个字段名
table2\u id
present

请描述您的问题。