This is the error of the code report:
$q = Doctrine_Query::create()->from('FzAnswerquestionResult r')->leftJoin('r.FzUsers u ON r.fb_id = u.user_id') ->groupBy('r.fb_id')->where('r.is_delete = 0 and u.province = "'.$province.'" and r.end_time >= '.$starttime.' and r.end_time <= '.$endtime);
500 | Internal Server Error | Doctrine_table_exceptionunknown relation alias Fzusersstack Trace at () in Sf_root_dir\lib\symfony\lib\plugins\sfdoc trineplugin\lib\vendor\doctrine\doctrine\relation\parser.php Line 237 ... return $this->getrelat Ion ($alias, false); } else {throw new doctrine_table_exception (' Unknown relation alias '. $alias); }} at Doctrine_relation_parser->getrelation (' Fzusers ',) in Sf_root_dir\lib\symfony\lib\plugins \sfdoctrineplugin\lib\vendor\doctrine\doctrine\relation\parser.php Line 235 ... at doctrine_relation_parser-> Getrelation (' Fzusers ', 1) in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\ table.php Line 1001 ... at doctrine_table->getrelation (' fzusers ') in Sf_root_dir\lib\symfony\lib\plugins\sfdoctri neplugin\lib\vendor\doctrine\doctrine\query.php Line 1762 ... at Doctrine_query->load ('R.fzusers u on r.fb_id = u.user_id ") in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\ Doctrine\query\from.php line in Doctrine_query_from->parse (' left JOIN r.fzusers u on r.fb_id = u.user_id ') In sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query\abstract.php line 2084 ... at Doctrine_query_abstract->_processdqlquerypart ("from", Array (' Fzanswerquestionresult R ', ' left JOIN R. Fzusers u on r.fb_id = u.user_id ")) in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\ doctrine\query.php Line 1183 ... at Doctrine_query->buildsqlquery () in Sf_root_dir\lib\symfony\lib\plugins\sfdoct Rineplugin\lib\vendor\doctrine\doctrine\query.php line 1149 ... at Doctrine_query->getsqlquery (Array (),) in SF_R oot_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query.php Line 2042 ... at Doctrine_ Query->getcountsqlquery () in Sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query.php line 2132 ... at Doctrine_query->count () sf_root_dir\lib\model\doctrine\fzanswerquestionresult.class.php line ... at fzanswerquestionresult-> Getfbthisissueusernumbyprovince (' Beijing ', 1388332800, 1397475117) in sf_root_dir\apps\frontend\modules\exam\actions\ Actions.class.php line 1313 ... at Examactions->executefbexamprovincerank (object (' Sfwebrequest ')) in sf_root_dir\ lib\symfony\lib\action\sfactions.class.php Line 60 ...} Run Action return $this $actionToRun ($request); }} at Sfactions->execute (object (' Sfwebrequest ')) in Sf_root_dir\lib\symfony\lib\filter\sfexecutionfil ter.class.php line ... at Sfexecutionfilter->executeaction (object (' Examactions's)) in sf_root_dir\lib\symfony\l ib\filter\sfexecutionfilter.class.php line ... at Sfexecutionfilter->handleaction (object (' Sffilterchain '),Object (' Examactions ')) in sf_root_dir\lib\symfony\lib\filter\sfexecutionfilter.class.php line ... at sfexecutionf Ilter->execute (Object (' Sffilterchain ')) in sf_root_dir\lib\symfony\lib\filter\sffilterchain.class.php line 53 ... at Sffilterchain->execute () on sf_root_dir\lib\symfony\lib\filter\sfrenderingfilter.class.php line 33 ... At Sfrenderingfilter->execute (the object (' Sffilterchain ')) in Sf_root_dir\lib\symfony\lib\filter\ sfFilterChain.class.php line ... at Sffilterchain->execute () in Sf_root_dir\lib\symfony\lib\controller\sfcontr Oller.class.php Line 238 ... at sfcontroller->forward (' exam ', ' Fbexamprovincerank ') in Sf_root_dir\lib\symfony\li b\controller\sffrontwebcontroller.class.php line ... at Sffrontwebcontroller->dispatch () in SF_ROOT_DIR\lib\sy mfony\lib\util\sfcontext.class.php line ... at Sfcontext->dispatch () on sf_root_dir\web\index.php line 7 ... s Ymfony Settings ... request ... response. User ... GloBal vars symfony v.1.4.17-php 5.2.6for help resolving this issue, please visit http://www.symfony-project.org/.
Reply content:
This is the error of the code report:
$q = Doctrine_Query::create()->from('FzAnswerquestionResult r')->leftJoin('r.FzUsers u ON r.fb_id = u.user_id') ->groupBy('r.fb_id')->where('r.is_delete = 0 and u.province = "'.$province.'" and r.end_time >= '.$starttime.' and r.end_time <= '.$endtime);
500 | Internal Server Error | Doctrine_table_exceptionunknown relation alias Fzusersstack Trace at () in Sf_root_dir\lib\symfony\lib\plugins\sfdoc trineplugin\lib\vendor\doctrine\doctrine\relation\parser.php Line 237 ... return $this->getrelat Ion ($alias, false); } else {throw new doctrine_table_exception (' Unknown relation alias '. $alias); }} at Doctrine_relation_parser->getrelation (' Fzusers ',) in Sf_root_dir\lib\symfony\lib\plugins \sfdoctrineplugin\lib\vendor\doctrine\doctrine\relation\parser.php Line 235 ... at doctrine_relation_parser-> Getrelation (' Fzusers ', 1) in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\ table.php Line 1001 ... at doctrine_table->getrelation (' fzusers ') in Sf_root_dir\lib\symfony\lib\plugins\sfdoctri neplugin\lib\vendor\doctrine\doctrine\query.php Line 1762 ... at Doctrine_query->load ('R.fzusers u on r.fb_id = u.user_id ") in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\ Doctrine\query\from.php line in Doctrine_query_from->parse (' left JOIN r.fzusers u on r.fb_id = u.user_id ') In sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query\abstract.php line 2084 ... at Doctrine_query_abstract->_processdqlquerypart ("from", Array (' Fzanswerquestionresult R ', ' left JOIN R. Fzusers u on r.fb_id = u.user_id ")) in sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\ doctrine\query.php Line 1183 ... at Doctrine_query->buildsqlquery () in Sf_root_dir\lib\symfony\lib\plugins\sfdoct Rineplugin\lib\vendor\doctrine\doctrine\query.php line 1149 ... at Doctrine_query->getsqlquery (Array (),) in SF_R oot_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query.php Line 2042 ... at Doctrine_ Query->getcountsqlquery () in Sf_root_dir\lib\symfony\lib\plugins\sfdoctrineplugin\lib\vendor\doctrine\doctrine\query.php line 2132 ... at Doctrine_query->count () sf_root_dir\lib\model\doctrine\fzanswerquestionresult.class.php line ... at fzanswerquestionresult-> Getfbthisissueusernumbyprovince (' Beijing ', 1388332800, 1397475117) in sf_root_dir\apps\frontend\modules\exam\actions\ Actions.class.php line 1313 ... at Examactions->executefbexamprovincerank (object (' Sfwebrequest ')) in sf_root_dir\ lib\symfony\lib\action\sfactions.class.php Line 60 ...} Run Action return $this $actionToRun ($request); }} at Sfactions->execute (object (' Sfwebrequest ')) in Sf_root_dir\lib\symfony\lib\filter\sfexecutionfil ter.class.php line ... at Sfexecutionfilter->executeaction (object (' Examactions's)) in sf_root_dir\lib\symfony\l ib\filter\sfexecutionfilter.class.php line ... at Sfexecutionfilter->handleaction (object (' Sffilterchain '),Object (' Examactions ')) in sf_root_dir\lib\symfony\lib\filter\sfexecutionfilter.class.php line ... at sfexecutionf Ilter->execute (Object (' Sffilterchain ')) in sf_root_dir\lib\symfony\lib\filter\sffilterchain.class.php line 53 ... at Sffilterchain->execute () on sf_root_dir\lib\symfony\lib\filter\sfrenderingfilter.class.php line 33 ... At Sfrenderingfilter->execute (the object (' Sffilterchain ')) in Sf_root_dir\lib\symfony\lib\filter\ sfFilterChain.class.php line ... at Sffilterchain->execute () in Sf_root_dir\lib\symfony\lib\controller\sfcontr Oller.class.php Line 238 ... at sfcontroller->forward (' exam ', ' Fbexamprovincerank ') in Sf_root_dir\lib\symfony\li b\controller\sffrontwebcontroller.class.php line ... at Sffrontwebcontroller->dispatch () in SF_ROOT_DIR\lib\sy mfony\lib\util\sfcontext.class.php line ... at Sfcontext->dispatch () on sf_root_dir\web\index.php line 7 ... s Ymfony Settings ... request ... response. User ... GloBal vars symfony v.1.4.17-php 5.2.6for help resolving this issue, please visit http://www.symfony-project.org/.
Http://docs.doctrine-project.org/en/2.0.x/reference/query-builder.html
That's the way it should be:
Doctrine_Query::create()->from('FzAnswerquestionResult r')->leftJoin('r.FzUsers', 'u')