/    Sign up×
Community /Pin to ProfileBookmark

Dependent drop down

Actually i need a code relating to the dependent dropdown using same database table.
can we fetch ??if so please help me

In advance Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@KrishnaaauthorJun 06.2015 — Hi,

I'm unable to make the 3 dependent drop downs using the same database table.if i use the the another two tables it works fine.i want with only one database table to use

please help me out...
Copy linkTweet thisAlerts:
@jimr451Jun 08.2015 — Krishnaa,

We'd need a specific example here to help out - can you post the database table structure, and what 3 drop downs you want to derive from it?

-Jim
Copy linkTweet thisAlerts:
@KrishnaaauthorJun 09.2015 — http://phppot.com/demo/jquery-dependent-dropdown-list-countries-and-states/

check this one in the above specified link they have taken 2 tables but here i need to retrive it from a single database table

my database table comprises of userid,fname,lname,email,phone,password,companyname,location,different crops

and the three dependent dropdowns are Company name,location and crop

in some companies have different branches so i need to display them when the company is got selected accordingly the branch available with the crops

Thanks in Advance..!!
Copy linkTweet thisAlerts:
@jimr451Jun 09.2015 — http://phppot.com/demo/jquery-dependent-dropdown-list-countries-and-states/

check this one in the above specified link they have taken 2 tables but here i need to retrive it from a single database table

my database table comprises of userid,fname,lname,email,phone,password,companyname,location,different crops

and the three dependent dropdowns are Company name,location and crop

in some companies have different branches so i need to display them when the company is got selected accordingly the branch available with the crops

Thanks in Advance..!![/QUOTE]



Well, if you are populating a list for the "User" to select from, you'll need three tables - to put in all the possible values for each.

If you are doing a search of entered values (to allow someone to filter out the list), then you could use that 1 table and pull distinct values for each field (3 queries).

Either way it's a bit complicated to answer in a forum post, but that tutorial may give you enough sample code to piece it together.

-Jim
×

Success!

Help @Krishnaa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...