Hi All,
I am still trying to piece all of this together and any help would be apprciated.
I have the code (see below) to retrieve data from my sql database. The data being pulled into the dropdown is the user name. There are two additional fields in the database - password and e-mail address.
Now that I have the user name in the dropdown for the end user to select I am not sure how to display the records associated with their selection? Here is what I have so far.
<body>
<form method="post" action="drop.php">
<select id="user" name="user">
<?php
$mysqlserver="localhost";
$mysqlusername="root";
$mysqlpassword="";
$link=mysql_connect(localhost, $mysqlusername, $mysqlpassword) or die ("Error connecting to mysql server: ".mysql_error());
$dbname = 'members';
mysql_select_db($dbname, $link) or die ("Error selecting specified database on mysql server: ".mysql_error());
$myquery="SELECT username FROM members";
$myresult=mysql_query($myquery) or die ("Query to get data from members failed: ".mysql_error());
while ($row=mysql_fetch_array($myresult)) {
$user=$row[username];
echo "<option>
$user
</option>";
}
?>
</select>
</form>
</body>
Thank you for any help you may be able to give.