posto nuovamente codice php:capita solo stesso cognome
Codice:
<?php
for ($i = 1; $i <= 1; ++$i) {
?>
<b>* Socio:</b><select class="form-control" width="80%" required name="utente-<?php echo $i;?>" id="utente-<?php echo $i;?>">
<option value="" selected>Seleziona socio</option>
<?php
$result = $mysqli->query("SELECT sociapprovati2021.Cognome, sociapprovati2021.Nome FROM sociapprovati2021 ORDER BY sociapprovati2021.Cognome, sociapprovati2021.Nome", MYSQLI_USE_RESULT);
while($row = $result->fetch_assoc())
{
?>
<option value="<?php echo $row['Cognome']."*". $row['Nome'];?>"><?php echo $row['Cognome']." ". $row['Nome'];?></option>
<br /><br />
<?php
}
$result->close();
?>
</select>
</div>
<table class='table table-bordered'>
<tr style="background-color:#fff; border:2px solid #bdbebd">
<th>Annuale</th><th style="background-color:#e9e9e9; border:2px solid #bdbebd"></th><th>Arma lunga</th><th style="background-color:#e9e9e9; border:2px solid #bdbebd"></th><th>Privèe</th><th style="background-color:#e9e9e9; border:2px solid #bdbebd"></th>
</tr>
</table><hr />