Carmine_Annunziata

EsameDiStato

Jun 11th, 2020
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5. </head>
  6. <body>
  7. <?php  
  8.  
  9.     $host = "localhost";
  10.     $user = "root";
  11.     $pass = "";
  12.  
  13.     $conn = @mysqli_connect($host, $user, $pass);
  14.  
  15.         if (mysqli_connect_errno())
  16.         {
  17.         die("Connessione fallita: " . mysqli_connect_error());
  18.         }
  19.  
  20.     mysqli_select_db($conn, 'Esame_di_Stato');
  21.  
  22.     $query = "select Viaggiatore.Cognome,Viaggiatore.Nome,Località,Data_Partenza,Data_ritorno,Stato_Viaggio from Viaggio natural join
  23.              Prenotazione natural join Viaggiatore where Viaggiatore.Cognome like “S%”";
  24.  
  25.     echo "<table border='2'>";
  26.     echo "<tr><th>Viaggiatore Cognome</th><th>Viaggiatore Nome</th><th>Località</th><th>Data Partenza</th><th>Data ritorn</th><th>Stato
  27.                  Viaggio</th></tr>";
  28.  
  29.     $result = @mysqli_query($conn, $query);
  30.     if(@mysqli_num_rows($result)!=0){
  31.         while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
  32.  
  33.             echo "<form method='post' action='http://localhost/Esame_di_Stato' >";
  34.  
  35.             echo
  36.  
  37.             "<tr>
  38.  
  39.             <td><input type='text' name='Viaggiatore.Cognome' value='". $row["Viaggiatore.Cognome"] ."'' required></td>
  40.  
  41.             <td><input type='text' name='Viaggiatore.Nome' value='". $row["Viaggiatore.Nome"] ."'' required></td>
  42.  
  43.             <td><input type='text' name='Località' value='". $row["Località"] ."'' required></td>
  44.  
  45.             <td><input type='date' name='Data_Partenza' value='". $row["Data_Partenza"] ."'' required></td>
  46.            
  47.             <td><input type='date' name='Data_ritorno' value='". $row["Data_ritorno"] ."'' required></td>
  48.            
  49.             <td><input type='text' name='Stato_Viaggio' value='". $row["Stato_Viaggio"] ."'' required></td>
  50.            
  51.  
  52.             </tr>";
  53.  
  54.             echo "</form>";
  55.         }
  56.     }
  57.  
  58.  
  59.     echo "</table>";
  60.    
  61. ?>
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment