Dear All:
Anybody could advices me on this.
On my page, there are 2 option selector. 1 for category and 1 for subcategory.
The category option selector coding as below:
[php]
<?php include("list_var.php"); $db = mysql_connect($server,$dbuser,$dbpasswd); mysql_select_db($dbname); $sqlcat; $sqlsub; $result = mysql_query($sqlcat); if (!$result) { echo "Could not successfully run query ($sqlcat) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } while ($row = mysql_fetch_assoc($result)) { echo ""; echo $row["category"]; echo ""; } mysql_free_result($result); echo ""; echo ""; [/php] [b] What i want is, when user change the category code on the option selector. It will dynamically retrieve subcategory belong to the select category [/b] The tables structure to capture the category, subcategory and catedory_subcategory table as belows: [b]category:[/b] id category description [b]subcategory[/b] id subcategory description [b]maincat_subcat[/b] category subcategory Thanks