Hy below are my code. all is working ok but their are two fields "town" "UC" they are relevant to each other,every town have specific UC numbers, i just want when i select any town name (Iqbal, jinnah, layllpur, or madina) the UC filed automatically filtered with specific union numbers related to town.the code is belowthanks in advance[code<html>

$nume = mysql_num_rows ($main2); $main = mysql_query ("SELECT * FROM main ORDER BY Complaint_Number DESC LIMIT $start,$limit") or error_Message (mysql_error()); // if no record exist if (mysql_num_rows ($main) <=0) { error_Message ("No record in result table"); }

pkimran wrote:all is working ok but their are two fields "town" "UC" they are relevant to each other,every town have specific UC numbers, i just want when i select any town name (Iqbal, jinnah, layllpur, or madina) the UC filed automatically filtered with specific union numbers related to town.

Just remember that PHP is executed SERVER side, not CLIENT side. So if you want PHP to accomplish this, only provide them one field and auto-populate based upon their response. If you want to accomplish this on the CLIENT side before submitting the form, your best bet is to use JavaScript to do the filtering for the user.