hi friends,
i want to display data from mySQL database, and iam using two drop down list, displaying data in second drop down list depending on the selecting from first drop down list, for example:
first drop down list contains states, and second drop down list contains cities.
almualim
0
Light Poster
Recommended Answers
Jump to PostThis has been discussed so many times. Either use ajax or this way. In the first dropdown list, list all the states. Have an onchange event to submit the form for the 1st dropdown list. When a user selects an option from the 1st dropdown list, onchange event will be …
Jump to PostCan you post your code here ?
Jump to PostFirst of all, you don't have an onchange event to submit the page. secondly, you should have a value for the option. Here is a simple example. I haven't tested it, but it should work with little tuning (which you have to figure it yourself !)
<?php …
Jump to PostOkay ! Well, I just re-wrote the whole code and it works ! Change the column names and tablename to suit your needs ! :) If this doesn't work, then, I don't know, something must be wrong from your side.
<?php $con = mysql_connect("localhost","root"); mysql_select_db("test"); $firstdropdownlistvalue = …
Jump to PostHi, the above code works fine. You just have to change the tablenames/column names. Anyway, When the page gets submitted, echo the value of 1st dropdownlist. See if the value is passed correctly. If yes, then the problem must be with your 2nd query. Check your query. See if your …
All 21 Replies
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
almualim
0
Light Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.