I have a query that populates a dropdwon <select> which then posts to another
form with a <selected> query
I don't want to diplay the dropdwon in the next form but want to keep the query.
Is it possible to justcombine the two queries . The reson for this is that the
2nd dropdown is populated by the selected value of the forst drop down :)
Meet the queries:)
this is the one I want to keep bu combine/or hide
<?
require("connection.php");
mysql_connect("$DBHost", "$DBUser", "$DBPass") or
die("could not connect");
mysql_select_db("$DBName");
echo "<select name=\"CountyID\" size=\"1\" class='menuForm'>";
$result=mysql_query("SELECT County, CountyID FROM county ORDER BY County");
while ($row = mysql_fetch_array($result)) {
$county_id=$row['CountyID'];
$county=$row['County'];
echo "<option value=\"$county_id\"";
if ($CountyID == $county_id)
{echo " selected";}
echo "> $county </option>";
}
echo "</select>";
?>
<br />
the one to display and keep:)
<?
echo "<select name=\"CityID\" size=\"1\" class='menuForm'>";
echo '<option value="0">Select Town or City</option>';
$result=mysql_query("SELECT CountyID, City, CityID FROM city WHERE
CountyID=".$CountyID." ORDER BY City");
while ($row = mysql_fetch_array($result))
{
$county_id=$row['CountyID'];
$city_id=$row['CityID'];
$city=$row['City'];
echo "<option value='$city_id'> $city </option>";
}
echo "</select>";
?>
Andrew
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php