Symfony framework error: Unknownrelationaliass

Source: Internet
Author: User
This is the code error: {code ...}

Is the error reported by this Code:

$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 | alarm relation alias FzUsersstack trace at () in SF_ROOT_DIR \ lib \ symfony \ lib \ plugins \ sfDoctrinePlugin \ lib \ vendor \ doctrine \ Doctrine \ Relation \ Parser. php line 237... return $ this-> getRelation ($ 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 \ sfDoctrinePlugin \ 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 88... at 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 \ sfDoctrinePlugin \ lib \ vendor \ doctrine \ Doctrine \ Query. php line 1149... at Doctrine_Query-> getSqlQuery (array (),) in SF_ROOT_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 () in SF_ROOT_DIR \ lib \ model \ doctrine \ FzAnswerquestionResult. class. php line 400... at FzAnswerquestionResult-> getfbthissueusernumbyprovince ('beijing', 1388332800,139 74720.7) in SF_ROOT_DIR \ apps \ frontend \ modules \ exam \ 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 \ sfExecutionFilter. class. php line 92... at sfExecutionFilter-> executeAction (object ('examactions') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfExecutionFilter. class. php line 78... at sfExecutionFilter-> handleAction (object ('sffilterchain'), object ('examactions') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfExecutionFilter. class. php line 53... at sfExecutionFilter-> execute (object ('sffilterchain') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfFilterChain. class. php line 53... at sfFilterChain-> execute () in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfRenderingFilter. class. php line 33... at sfRenderingFilter-> execute (object ('sffilterchain') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfFilterChain. class. php line 53... at sfFilterChain-> execute () in SF_ROOT_DIR \ lib \ symfony \ lib \ controller \ sfController. class. php line 238... at sfController-> forward ('expam', 'fbexamprovincerank ') in SF_ROOT_DIR \ lib \ symfony \ lib \ controller \ sfFrontWebController. class. php line 48... at sfFrontWebController-> dispatch () in SF_ROOT_DIR \ lib \ symfony \ lib \ util \ sfContext. class. php line 170... at sfContext-> dispatch () in SF_ROOT_DIR \ web \ index. php line 7... symfony 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:

Is the error reported by this Code:

$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 | alarm relation alias FzUsersstack trace at () in SF_ROOT_DIR \ lib \ symfony \ lib \ plugins \ sfDoctrinePlugin \ lib \ vendor \ doctrine \ Doctrine \ Relation \ Parser. php line 237... return $ this-> getRelation ($ 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 \ sfDoctrinePlugin \ 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 88... at 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 \ sfDoctrinePlugin \ lib \ vendor \ doctrine \ Doctrine \ Query. php line 1149... at Doctrine_Query-> getSqlQuery (array (),) in SF_ROOT_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 () in SF_ROOT_DIR \ lib \ model \ doctrine \ FzAnswerquestionResult. class. php line 400... at FzAnswerquestionResult-> getfbthissueusernumbyprovince ('beijing', 1388332800,139 74720.7) in SF_ROOT_DIR \ apps \ frontend \ modules \ exam \ 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 \ sfExecutionFilter. class. php line 92... at sfExecutionFilter-> executeAction (object ('examactions') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfExecutionFilter. class. php line 78... at sfExecutionFilter-> handleAction (object ('sffilterchain'), object ('examactions') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfExecutionFilter. class. php line 53... at sfExecutionFilter-> execute (object ('sffilterchain') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfFilterChain. class. php line 53... at sfFilterChain-> execute () in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfRenderingFilter. class. php line 33... at sfRenderingFilter-> execute (object ('sffilterchain') in SF_ROOT_DIR \ lib \ symfony \ lib \ filter \ sfFilterChain. class. php line 53... at sfFilterChain-> execute () in SF_ROOT_DIR \ lib \ symfony \ lib \ controller \ sfController. class. php line 238... at sfController-> forward ('expam', 'fbexamprovincerank ') in SF_ROOT_DIR \ lib \ symfony \ lib \ controller \ sfFrontWebController. class. php line 48... at sfFrontWebController-> dispatch () in SF_ROOT_DIR \ lib \ symfony \ lib \ util \ sfContext. class. php line 170... at sfContext-> dispatch () in SF_ROOT_DIR \ web \ index. php line 7... symfony 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

It should be like this:

Doctrine_Query::create()->from('FzAnswerquestionResult r')->leftJoin('r.FzUsers', 'u')

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.