SELECT * from meets
LEFT JOIN teams as hteam on meets.meet_hometeam=hteam.team_id
LEFT JOIN teams as ateam on meets.meet_awayteam=ateam.team_id
LEFT JOIN teams as altloc on (meets.meet_altloc=altloc.team_id and meets.meet_altloc!='')
where meet_date between ($now+(4*86400)) and ($now+(5*86400) or meets.meet_id='2')
在 PHP 中:
$var = $queryvar->fetch_object();
当我称$var->ateam.team_town
它只是将点视为连接而不是表的对象时,我遇到了问题。