我有一个查询
SELECT post.*
FROM wp_posts as post ,
wp_term_relationships as term_relation,
wp_term_taxonomy as term_texomony,
wp_icl_translations as trans
WHERE post.post_status='publish'
AND post.post_type='post'
AND trans.language_code = 'en'
AND trans.element_type = 'post_post'
AND post.ID = trans.element_id
AND post.post_date < '2010-03-31'
AND term_texomony.term_taxonomy_id = term_relation.term_taxonomy_id
AND post.ID = term_relation.object_id
GROUP BY post.ID
当我尝试通过
执行此查询时$data = R::getAll($sql);
或
$data = R::exec($sql);
这两行将 PHP致命错误作为
返回Fatal error: Call to a member function isFrozen() on a non-object in rb.php on line 9078
这是运行此查询的任何方式,还是无法在RedBeanPHP中运行复杂查询?
答案 0 :(得分:1)
这个致命错误告诉我们R是非对象的,经过大量调试后我发现了一些代码来解除R,所以我们必须通过以下方式重新定义R:
R::setup('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD);