$sql = "SELECT events.*, leagues.lname as leagueName,leagues.aliasname as AliasName, t1.tname as team1_name, t2.tname as team2_name
FROM events
INNER JOIN leagues ON events.leagueid = leagues.id
INNER JOIN teams AS t1 ON events.teamhid = t1.teamid
INNER JOIN teams AS t2 ON events.teamaid = t2.teamid
WHERE sdate='1352835000' ";
它给出了带有COLUMNS的 TABLE :
id sdate ... leagueName AliasName team1_name team2_name
如何添加附加条件:
WHERE AliasName LIKE 'word' AND (team1_name LIKE 'word2' OR team2_name LIKE 'word3')