thanks for replying, I am pas that they will just have to do it. Here is another question for you. How do I have the field for the select box change based on the selected Field, the field is defined by $sort.
Here is the script.
$query1_result = mysql_query ("SELECT DISTINCT $sort FROM LUTHERSELLANDRECOMMEND");
$num_results = mysql_num_rows($query1_result );
$catagories = array();
//use the for loop to populate the array with the unitnos from the query
for ($i=0; $i<$num_results; $i++)
{
'$sort'_row=mysql_fetch_object($query1_result );
$catagories[]='$sort'_row->'$sort';
}
//start the dropdown box
echo "<select name=\"'$sort'\" value=\"'$sort'\" size=\"50\" multiple>";
//detect if this script has been submited yet
if (!isset ($'$sort'))
{
$selected_'$sort' = "";
}
else
{
$selected_'$sort' = $'$sort';
}
if ($selected_'$sort' == "")
{
echo "<option value=\"\" SELECTED>SELECT '$sort'</option>";
}
else
{
echo "<option value=\"\" >SELECT '$sort'</option>";
}
//populate the option and prov'$sort'e a SELECTED option for each item in the array
foreach ($catagories as $'$sort')
{
if ($selected_'$sort' == $'$sort')
{
echo "<option value=\"$'$sort'\" SELECTED >$'$sort'</option>";
}
else
{
echo "<option value=\"$'$sort'\" >$'$sort'</option>";
}
}
echo "</select><br>";
echo "<input type=submit value=Submit name=Submit>\n";
echo "</form>\n";