Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Jak przekazać parametr
-szczotkap-
post
Post #1





Goście







Witam.

Chciałbym zrobić mały system do rezerwacji.
Mój kod pobiera z MySql z tabeli dane i wyświetla je na stronie:

[Musiałam wyciąć bo Geshi zwariowało]

Co robię źle. Jak rozwiązać ten problem?
Powód edycji: [Daiquiri]: Wycinka
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-szczotkap-
post
Post #2





Goście







Zmieniłem na GET, jednak w dalszym ciągi nie wyświetla nic.

Kod
<?php
// Connects to your Database
mysql_connect("admin", "admin", "admin") or die(mysql_error());
mysql_select_db("admin") or die(mysql_error());
$data = mysql_query("SELECT * FROM terminy")
or die(mysql_error());

while($info = mysql_fetch_array( $data ))
{

Print "<table border=5 cellpadding=4 width=700>";
Print "<tr>";
Print "<th>Termin:</th> <td bgcolor=#133481 align=center width=250> ".$info['nazwa_terminu'] . "</td> ";
Print " <td  bgcolor=#133481 align=center>".$info['rok'] . " </td>";
Print "<th>Ilość wolnych miejsc:</th> <td align=center width=50>".$info['wolne_miejsca'] . " </td>";
Print "<td align=center width=50><form action=rezerwuj.php method=GET><input type=submit name=".$info['nazwa_terminu'] . " value=rezerwuj ></td>";
Print "</tr>";
Print "</table>";
}


?>


Plik docelowy:

Kod
<html>
<head>
  <title>
   Wyniki
  </title>
</head>
<body>
  Wybór:
  <?php echo $_GET['nazwa_terminu']?><br>
  
</body>
</html>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 13.10.2025 - 22:30