hello programmers again really need your help with this, i Need a menu linked to a sub menu
i have a menu code and a submenu code but they arent linked, both i select manually, so i need help linking both of them.
the menu consist of two values team1 and team2 i want when i select team1 it should drop down a menu of users who selected team1 and vice versa.
for the MENU we got two tables they are
auctions: with column: id team1 team2
bids: with column: auction bidder willwin
and for the submenu we also have two tables
bids with: column: auction bidder willwin
users with: column: nick
MENU CODE
// MENU team select
$query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin, b.willlose FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id)
WHERE a.id = :auc_id and a.id = a.id group by a.id";
$params = array();
$params[] = array(':auc_id', $id, 'int');
$db->query($query, $params);
$TPL_team_list = '<select name="willwin" class="form-control">' . "\n";
while ($row = $db->fetch())
{
$TPL_team_list .= "\t" . '
<option value="' . $row[''] . '" ' . $selected . '>' . $row[''] . '</option>
<option class="team1" value="' . $row['team1'] . '" ' . $selected . '>' . $row['team1'] . '</option>
<option class="team2" value="' . $row['team2'] . '" ' . $selected . '>' . $row['team2'] . '</option>
' . "\n";
}
$TPL_team_list .= '</select>' . "\n";
{
$template->assign_block_vars('tag_bidder', array(
'TEAM' => $TPL_team_list,
));
$i++;
}
SUBMENU CODE
// SUBMENU user name
$query = "SELECT b.*, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b
LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder)
WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('b.bidder') and b.auction = :auc_id order by b.willwin";
$params = array();
$params[] = array(':auc_id', $id, 'int');
$db->query($query, $params);
$TPL_team_list = '<select name="tagged" class="form-control">' . "\n";
while ($row = $db->fetch())
{
$TPL_team_list .= "\t" . '
<option value="' . $row[''] . '" ' . $selected . '>' . $row[''] . '</option>
<option value="' . $row['bidder'] . '" ' . $selected . '>' . $row['nick'] . '...' . $row['willwin'] . '</option>
' . "\n";
}
$TPL_team_list .= '</select>' . "\n";
{
$template->assign_block_vars('tag_bidder', array(
'NAME' => $TPL_team_list,
));
$i++;
}
really looking forward to ur help thanks.