Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form action="insert.php" method="post">
- CodiceStanza:<input type="text" name="codice"><br>
- <input type ="submit" name="submit" value="Elimina">
- </form>
- <?php
- $host="localhost";
- $username="username";
- $password="password";
- $db_nome="database";
- // 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 ('Accesso non riuscito: ' . mysql_error());
- if(isset($_POST['submit'])){
- $codice = $_POST ['codice'];
- // comando SQL
- $sql =" DELETE FROM Stanza WHERE Codice = $Codice";
- if (mysql_query($sql)) {
- echo "Rimosso correttamente";
- } else {
- echo "Errore nell'inserimento: " . mysql_error();
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement