Hi ...
I'm trying to make a drop down list box populated from a mysql table.
It all looks OK on the screen, but there is an error that I cant seem to fix.
The error is:
Notice: Undefined index: xxx in C:\Documents and Settings\GSW\My Documents\xxx\test.php on line 29
and the code is:
<?php
include("openatname.php"); // access database
$result= mysql_query("SELECT DISTINCT d_sec FROM domains WHERE d_genre LIKE 'family'"); // find records that include 'family' in the d_genre column.
$domainecho =""; // put the form in an echo for easier positioning on an html page
$domainecho.="<form name='GetDomain' method='post'>";
$domainecho.="<select name=xxx size=12 style='width: 150px'>";
while($row = mysql_fetch_array($result))
{
$y=$row['d_sec'];
$domainecho.="<option value=$y>$y</option>";
}
$domainecho.=" </select>
<input type=submit>
</form>";
echo $domainecho; // this form output can be placed anywhere on page using <div>
$domain=$_POST['xxx'];
echo "<br><br><br>". $domain;
?>
Any ideas?
G-fer