I am doing this...
- querying information from a table other then the table I am inserting it to.
the query table is xoops_users
the table I will be inserting is xoops_wins
I am having trouble getting the second drop down menu to appear. What is happening is the script echo's the first list/menu but for the second, its just querying and printing the query without the list drop down.
Also, does this look in order to where it should submit the info to the database.
if ($submit) {
// process form
$sql = "INSERT INTO xoops_wins (user_id,uname,win,published,vrs) VALUES ('$user_id','$uname','$win','$published','$vrs')";
$result = mysql_query($sql);
echo "thank you";
}else{
?>
<table><tr><td>
<form action='<?php echo $PHP_SELF?>' method='post');'>
<br /><br />
<?php
echo "<select name=\"uid\">";
$query = "select uid, uname from xoops_users order by uname";
$result = mysql_query($query);
while(list($uid,$uname) = mysql_fetch_array($result)) {
echo "<option value=\"$uid\">$uname</option>";
}
echo "<br /><select name=\"uname\">";
$query2 = "select uname from xoops_users order by uname";
$result = mysql_query($query2);
while(list($uname) = mysql_fetch_array($result)) {
echo "<option value=\"$uname\">$uname</option>";
}
echo "<input type='submit' name='submit' value='enter information' />\n";
echo "</form>\n";
echo "</td></tr></table>\n";
unset($submit_page);
}
?>