Ok this is my code:
It's dutch but that's not important for the moment.
Although the select for uitploeg and thuisploeg is exactly the same, i don't get an output for uitploeg: see it here
http://www.fcbfans.be/new/admin/admin_matchen.php?act=toevoegen
<?php
/*******************************************
MATCHEN
*******************************************/
include("../includes/connect.php");
include("../includes/meta.php");
$pagina_naam = "Matchen toevoegen, verwijderen of wijzigen";
//
// MATCHEN TOEVOEGEN
//
if($act == "toevoegen") {
if(!empty($uitploeg) AND !empty($thuisploeg) AND $uitploeg != $thuisploeg) {
$sql = "insert into seizoen_matchen set thuisploeg='$thuisploeg', uitploeg='$uitploeg'";
mysql_query($sql) or die(mysql_error());
echo "De match is aan de database toegevoegd!";
} else {
$sql = "select naam from matchen_tegenstanders order by naam asc";
$query = mysql_query($sql) or die(mysql_error());
?>
<form name="match" method="post" action="<?php echo $PHP_SELF; ?>">
Thuisploeg: <select name="thuisploeg">
<?php
while($result = mysql_fetch_array($query)) {
echo "<option selected>$result[naam]</option>";
}
?>
</select><br>
Uitploeg: <select name="uitploeg">
<?php
while($result = mysql_fetch_array($query)) {
echo "<option selected>$result[naam]</option>";
}
?>
</select><br>
<p>
<input type="submit" name="submit" value="Match toevoegen!">
</form>
<?php
}
}
?>
</body>