PHP populate the data from database when District is selected
01:05 24 Jul 2012

I have this code where a user selects the particular category of doctor and then the District in which he wants to look it. After state he needs to click the station(in the selected district) Doctor >> District >> Station

Here is the code 


Process.php

$mySqlStm ="SELECT Name FROM doctors WHERE Category='$myValue' and Station='$myStation'";

$result2 = mysql_query($mySqlStm) or die("Error:mysql_error()"); 

if(mysql_num_rows($result2) == 0){ 
echo("
no records found"); } ELSE { echo ""; //ECHO THE RECORDS FETCHED while($row = mysql_fetch_array($result2)) { echo ""; //echo ""; echo "" ; //echo ""; //echo ""; }

I want the station category to be auto filled when district is selected and When a category of doctor is selected, the district has to be auto filled.

How can I do it? I would prefer Javascript because I know a little bit about it. Also, i have all the data in one database it looks like this

Category | Station | District | Name | Qualification and so on

php javascript mysql database
" . $row['Station'] . "" . $row['Name'] . "" . $row['Phone 1'] . "" . $row['Mobile'] . "