Hi there,
Can I run a query within a custom function? I tried the following, but keep getting the: "Parse error: parse error, unexpected $..." error
function state ()
{
echo "State: <select name=\"state\"><option>Select One</option>:";
$query = "SELECT DISTINCT(state) FROM choices ORDER BY state asc";
$result = mysql_query ($query);
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
echo "<option value=\"{$row['state']}\">{$row['state']}</option>\n</select>";
}
As always, your help is greatly appreciated!