Thanks again.
One final question, I promise! Find my script so far below...it works but I am now looking to 'link' the two boxes.
Is it not possible to use "onChange" to get the value from the first select box and use it as the SQL WHERE clause for the 2nd box (to replace the ?????????? in the script below)? It would therefore retrieve the regions for the selected country.
Hope you can help again. Thank you,
Sarah.
<?php
function query_select($name, $query, $default="")
{
$result = mysql_query($query);
if (!$result)
return(0);
$select = "<SELECT NAME=\"$name\">";
$row = mysql_numrows($result);
for ($i=0; $i < $row; $i++)
{
$opt_code = mysql_result($result, $i, 0);
$select .= "<OPTION VALUE=\"$opt_code\"";
if ($opt_code == $default)
{
$select .= " SELECTED";
}
$select .= ">$opt_code </OPTION>";
}
$select .= "</SELECT>\n";
return($select);
}
$name = "country";
$query = "SELECT name FROM country";
$box = query_select($name, $query);
echo "$box";
$name = "region";
$query = "SELECT name FROM region WHERE country = ???????????????";
$box2 = query_select($name, $query);
echo "$box2";
?>