我正在运行以下查询,它返回一个 stcClass 对象数组,如下所示:
$result = db_query('SELECT node.title AS node_title,
node.nid AS nid,
node.created AS node_created,
\'node\' AS field_data_my_field_node_entity_type
FROM {node} node WHERE (( (node.status = :status)
AND (node.type IN (:type)) ))
ORDER BY node_created DESC',
array(':status'=>'1', ':type'=>'_my_content_type'));
stdClass Object
(
[node_title] => my sample title
[nid] => 331
[node_created] => 1367500781
[field_data_my_field_node_entity_type] => node
)
它返回一个 stdClass 对象数组。我的问题是,在“field_data_my_field_node_entity_type”字段中,我只有字符串“node”,因为它作为字符串传递到查询中。我对此知之甚少,但我想如果我有正确的语法,我可以在那里得到一个值。
知道这个查询应该如何工作吗?
提前致谢