我有兩個表並且通用性是tid。 $ tid是tourneys的主要關鍵,如果在team_tourney中,那麼球隊會選中它。下面的代碼迴應了一切,如果一個團隊選擇了它,但只刪除每個未選定項目的變量$ tid。你會如何建議我解決我的代理問題。如果這兩個表不共用,則加入下降變量
tables
team_tourneys
tourneys
我的SQL是
[email protected]_query("SELECT *
FROM tourneys
LEFT JOIN team_tourneys
ON tourneys.tid = team_tourneys.tid
WHERE tourney_state = '$region' AND tourney_start_date >= now()
GROUP BY tourneys.tid ORDER BY tourney_start_date ASC
");
if (!$myChoice)
{
die('<p>Error fetching Tourney details: ' .
mysql_error() . '</p>');
}
while ($choice = mysql_fetch_array($myChoice))
{
$tid = $choice['tid'];
$tourney_name = $choice['tourney_name'];
echo '<a href="http://www.mydomain.com/tournament-local.php?&tid='.$tid.'" class="red">'.$tourney_name.'</a></div>'
}
放下一個變量?那是什麼? –