Jeg har nu placeret det således:
<HTML>
<HEAD><TITLE>Brugersystem</TITLE></HEAD>
<BODY>
<?
$db = mysql_connect("localhost", "xxx", "xxx");
mysql_select_db("get-ready", $db);
if($skriv){
mysql_query("INSERT INTO brugersys (nick, navn, adresse, postnr, city, email) VALUES ('$nick', '$ddSingelvaerdi[1]', '$adresse', '$postnr', '$ddSingelvaerdi[0]', '$email');
}
?>
<table><tr><td>
<FORM METHOD=POST ACTION=<? echo $PHP_SELF; ?>>
<INPUT TYPE=hidden NAME=skriv VALUE=1>
Klub:</td><td>
<?php
{
$ddString=$_POST['valg'];
$ddSingelvaerdi=explode('_',$ddString);
$ddSingelvaerdi[0]; //første værdi ($row['klubber'])
$ddSingelvaerdi[1]; //anden værdi ($row['name'])
}
$hent = mysql_query("SELECT $ddSingelvaerdi[1], $ddSingelvaerdi[0] FROM klubber")
or die( "Unable to select. Reason: ".mysql_error());
{
echo "<select name='valg'>\n";
while ($row = mysql_fetch_array($hent)) {
echo " <option value='" .$row['klubber'] ."_". $row['name'] ."'>".$row['name'] ."</option>\n";
}
echo "</select>\n";
}
?>
</td></tr>
<tr><td>Nickname:</td><td><INPUT TYPE=text NAME=nick></td></tr>
<tr><td>Navn:</td><td><INPUT TYPE=text NAME=navn></td></tr>
<tr><td>Adresse:</td><td><INPUT TYPE=text NAME=adresse></td></tr>
<tr><td>Postnr:</td><td><INPUT TYPE=text NAME=postnr maxlength=4></td></tr>
<tr><td>By:</td><td><INPUT TYPE=text NAME=city></td></tr>
<tr><td>E-mail:</td><td><INPUT TYPE=text NAME=email></td></tr>
<tr><td><INPUT TYPE=submit VALUE="send"></td></tr>
</FORM>
</table>
<br><br><hr><br><br>
<?
$foresp = mysql_query("SELECT brugernummer, nick, navn, adresse, postnr, city, email FROM brugersys ORDER BY brugernummer DESC")or die(mysql_error());
while($data = mysql_fetch_assoc($foresp)){
echo "<table><tr><td>Brugernummer:</td><td> ". $data[brugernummer] ."</td></tr>";
echo "<tr><td>Nickname:</td><td> ". $data[nick] ."</td></tr>";
echo "<tr><td>Navn:</td><td> ". $data[navn] ."</td></tr>";
echo "<tr><td>Adresse:</td><td> ". $data[adresse] ."</td></tr>";
echo "<tr><td>Postnr:</td><td> ". $data[postnr] ."</td></tr>";
echo "<tr><td>By:</td><td> ". $data[city] ."</td></tr>";
echo "<tr><td>E-mail:</td><td> ". $data[email] ."</td></tr></table><br><hr><br>";
}
?>
</div>
</BODY>
</HTML>
http://www.get-ready.dk/test2.php -
nu får jeg bare fejlen: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/get-ready/test2.php on line 18