Cytat
<html>
<head>
<title> Dodawanie rekordów </title></head>
<body>
<form method="POST" action="dodaj.php">
Podaj nazwe: <input type="text" size="30" name="name"><br>
Podaj hp: <input type="text" size="40" name="hp"><br>
Podaj exp: <input type="text" size="40" name="exp"><br>
Podaj summon: <input type="text" size="40" name="summon"><br>
Podaj convince: <input type="text" size="40" name="convince"><br>
Podaj loot: <select name="loot" multiple="multiple" size="8">
<?php mysql_connect('localhost', 'root', '') or
die('Nie można się połączyć: ' . mysql_error());
mysql_select_db('haha');
$result = mysql_query("SELECT name,namelink FROM monsters");
if(mysql_num_rows($result) > 0) {
while($row123 = mysql_fetch_assoc($result))
{ echo '<option>'.$row123['name'].'</option>'; } }
?> </select>
<br>
Podaj wsytepowanie: <input type="text" size="40" name="occupation"><br>
Podaj opis: <input type="text" size="40" name="opis"><br>
Podaj odgłos: <input type="text" size="40" name="voice"><br>
<input type="submit" value="wyślij!">
</form>
</body>
</html>
<head>
<title> Dodawanie rekordów </title></head>
<body>
<form method="POST" action="dodaj.php">
Podaj nazwe: <input type="text" size="30" name="name"><br>
Podaj hp: <input type="text" size="40" name="hp"><br>
Podaj exp: <input type="text" size="40" name="exp"><br>
Podaj summon: <input type="text" size="40" name="summon"><br>
Podaj convince: <input type="text" size="40" name="convince"><br>
Podaj loot: <select name="loot" multiple="multiple" size="8">
<?php mysql_connect('localhost', 'root', '') or
die('Nie można się połączyć: ' . mysql_error());
mysql_select_db('haha');
$result = mysql_query("SELECT name,namelink FROM monsters");
if(mysql_num_rows($result) > 0) {
while($row123 = mysql_fetch_assoc($result))
{ echo '<option>'.$row123['name'].'</option>'; } }
?> </select>
<br>
Podaj wsytepowanie: <input type="text" size="40" name="occupation"><br>
Podaj opis: <input type="text" size="40" name="opis"><br>
Podaj odgłos: <input type="text" size="40" name="voice"><br>
<input type="submit" value="wyślij!">
</form>
</body>
</html>
Chodzi o to , żeby formularz pokazywał w "tabelce" select wszystkie nazwy potworów .. i gdy dam wyślij zapisało rekord w bazie
Gdy zamiast tego skryptu php dodam to co jest w innych wszystko gra.. a jak zmienię na tak jak jest teraz nie zapisuje się . Mógłby mi ktoś pomóc ?