Salve a tutti,come sempre ho bisogno di un vostro aiuto: effettuo una Select su di una tabella,il risultato mi esce correttamente,ora sopra al risultato mi compare una combobox con dei valori.Alla fine della pagina ho inserito il pulsante Aggiorna,quano lo clicco mi deve rieffettuare la Select nella stessa pagina,solo limitando la ricerca in base al valore selezionato.Spero di essere stato chiaro,comunque di seguito posto il codice:
<form method="post" action="sessioni_aperte.php">
<?php
$connection=mysql_connect("localhost","radiususer","fab10");
$db=mysql_select_db("radius",$connection);
$sql2="SELECT DISTINCT CalledStationId from radacct";
$result2=mysql_query($sql2);
$sql="SELECT UserName,AcctStartTime,AcctStopTime,CalledStationId,FramedIpAddress,AcctTerminateCause from radacct
WHERE radacct.AcctStopTime='0000-00-00 00:00:00'";
$result=mysql_query($sql) or die("query failed:".mysql_error());
echo '<table border="1">';
echo "<tr><td><font size='2'>Called Station Id</font></td><td><select name='statid'>";
echo "<option value='vuoto'> </option>";
while ($row=mysql_fetch_array($result2))
{
echo"<option value='".$row['CalledStationId']."'>".$row['CalledStationId']."</option>";
}
echo '<tr><td><h6>UserName</h6></td> <td><h6>AcctStartTime</h6></td> <td><h6>AccdStopTime</h6></td> <td><h6>CalledStationId</h6></td> <td><h6>FramedIpAddress</h6></td></tr>';
while ($row=mysql_fetch_array($result))
{
echo '<tr><td><font size="1">'.$row['UserName'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctStartTime'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctStopTime'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['CalledStationId'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['FramedIpAddress'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctTerminateCause'].'</font>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
echo '<br><br>';
echo '<input type="submit" value="Aggiorna">' ;
?>
</form>
-----------------------------------------------------------------
Grazie a tutti in anticipo
<form method="post" action="sessioni_aperte.php">
<?php
$connection=mysql_connect("localhost","radiususer","fab10");
$db=mysql_select_db("radius",$connection);
$sql2="SELECT DISTINCT CalledStationId from radacct";
$result2=mysql_query($sql2);
$sql="SELECT UserName,AcctStartTime,AcctStopTime,CalledStationId,FramedIpAddress,AcctTerminateCause from radacct
WHERE radacct.AcctStopTime='0000-00-00 00:00:00'";
$result=mysql_query($sql) or die("query failed:".mysql_error());
echo '<table border="1">';
echo "<tr><td><font size='2'>Called Station Id</font></td><td><select name='statid'>";
echo "<option value='vuoto'> </option>";
while ($row=mysql_fetch_array($result2))
{
echo"<option value='".$row['CalledStationId']."'>".$row['CalledStationId']."</option>";
}
echo '<tr><td><h6>UserName</h6></td> <td><h6>AcctStartTime</h6></td> <td><h6>AccdStopTime</h6></td> <td><h6>CalledStationId</h6></td> <td><h6>FramedIpAddress</h6></td></tr>';
while ($row=mysql_fetch_array($result))
{
echo '<tr><td><font size="1">'.$row['UserName'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctStartTime'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctStopTime'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['CalledStationId'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['FramedIpAddress'].'</font>';
echo '</td>';
echo '<td><font size="1">'.$row['AcctTerminateCause'].'</font>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
echo '<br><br>';
echo '<input type="submit" value="Aggiorna">' ;
?>
</form>
-----------------------------------------------------------------
Grazie a tutti in anticipo