Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
- Stanza:<input type="text" name="stanza"><br>
- <input type ="submit" name="submit" value="Invia">
- </form>
- <?php
- $host="localhost";
- $username="hellofriend";
- $password="";
- $db_nome="my_hellofriend";
- $tab_nome="";
- //connessione al server
- mysql_connect($host, $username, $password) or die('Impossibile connettersi al server: '.mysql_error());
- //accesso al database
- mysql_select_db($db_nome) or die ('Accessp al database non riuscito: '.mysql_error());
- // lettura dei dati dalla tabella
- $sql = "SELECT * FROM $tab_nome WHERE Stanza ='$stanza';";
- $result = mysql_query($sql);
- while($row = mysql_fetch_array($result)){
- echo "<table><tr><th>Codice</th><th>Nome</th></tr>";
- echo "<tr><td>" . $row["CodiceStanza"]. "</td><td>" . $row["Nome"]. "</td></tr>";
- echo "</table>";
- }
- ?>
Add Comment
Please, Sign In to add comment