Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,756 members, 7,809,920 topics. Date: Friday, 26 April 2024 at 05:10 PM

for 3k Need A Menu Linked To A Sub Menu - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / for 3k Need A Menu Linked To A Sub Menu (1002 Views)

How Do I Create Space Between The Menu(nav) And <h1> - Snapshot / Learn Any Programming Lang Of Ur Choice For 3k Per Language.. / Buy Real 1000 naija Instagram Followers For 3k,scam Free!!! (2) (3) (4)

(1) (Reply) (Go Down)

for 3k Need A Menu Linked To A Sub Menu by skyhighweb(m): 1:54pm On May 19, 2017
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.
Re: for 3k Need A Menu Linked To A Sub Menu by webdeveloperqx: 10:30pm On May 19, 2017
You will need more of javascript /jquery and css. you can fetch the users who match your constraints and loop your main menu same time loop the sub menu , thats is just like get all categories and why getting the categories get the sub categories as well.
Re: for 3k Need A Menu Linked To A Sub Menu by skyhighweb(m): 10:38pm On May 19, 2017
webdeveloperqx:
You will need more of javascript /jquery and css. you can fetch the users who match your constraints and loop your main menu same time loop the sub menu , thats is just like get all categories and why getting the categories get the sub categories as well.

if only i knew how to go about it, can u help with d code?
Re: for 3k Need A Menu Linked To A Sub Menu by webdeveloperqx: 2:52pm On May 20, 2017
okay, please paste your code at http://phpfiddle.org/ and your sample sql dump .

i will attend
Re: for 3k Need A Menu Linked To A Sub Menu by EmekaEmeruwa: 7:48pm On May 20, 2017
webdeveloperqx:
You will need more of javascript /jquery and css. you can fetch the users who match your constraints and loop your main menu same time loop the sub menu , thats is just like get all categories and why getting the categories get the sub categories as well.

pls i need a very good computer sch where i cand learn all this programming of a thing,web design e.t.c.pls can u help me out?
Re: for 3k Need A Menu Linked To A Sub Menu by Noblenerd: 11:13pm On May 23, 2017
Hi.... Have you been able to resolve it?
If you still need it, call or WhatsApp me on 07067961290

(1) (Reply)

Urgent Need For Experienced Php Developer / Build Mobile Apps For Yourself And Clients Without Coding Or Technical Skill / How To Create Form To Email?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.