SHARE
TWEET

Untitled

a guest May 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <?php
  4.     $lettera = $_POST["lettera"];
  5.     if(isset($lettera)){
  6.         include("connettoreDB.php");
  7.         $lettera = strtoupper($lettera);
  8.         $query = "SELECT CONCAT(s.Nome,' ',s.Cognome) as nominativo FROM `Studenti` as s, `Voti` as v WHERE s.Cognome LIKE '".$lettera."%' AND s.ID = v.ID_Studente AND v.Voto > 6 GROUP BY s.Cognome";
  9.         $result = mysqli_query($link, $query);
  10.         while($row = mysqli_fetch_array($result)){
  11.             print($row["nominativo"]);
  12.             print("<br>");
  13.         }
  14.     }
  15. ?>
  16. </head>
  17. <body>
  18. <form name = "f1" method = "POST" action = "">
  19. <select name = "lettera">
  20. <?php
  21.     // dal 65 al 90
  22.     for(c = 65; c<=90; c++){
  23.         print("<option value='".strtolower(chr(c))."'>".chr(c)."</option>");
  24.     }
  25. ?>
  26. </select>
  27. <input type = "submit" value = "invio">
  28. </form>
  29. </body>
  30. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top