Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <?php
- $lettera = $_POST["lettera"];
- if(isset($lettera)){
- include("connettoreDB.php");
- $lettera = strtoupper($lettera);
- $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";
- $result = mysqli_query($link, $query);
- while($row = mysqli_fetch_array($result)){
- print($row["nominativo"]);
- print("<br>");
- }
- }
- ?>
- </head>
- <body>
- <form name = "f1" method = "POST" action = "">
- <select name = "lettera">
- <?php
- // dal 65 al 90
- for(c = 65; c<=90; c++){
- print("<option value='".strtolower(chr(c))."'>".chr(c)."</option>");
- }
- ?>
- </select>
- <input type = "submit" value = "invio">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement