Back to top
<?php require_once JPATH_SITE.'/includes/php/user.php'; require_once JPATH_SITE.'/includes/php/dbConnection.php'; if (isset($_REQUEST["submit"])){ $selected = $_REQUEST['ric']; $ricerca = null; $valore = null; if ($selected == 'cognome') { $ricerca = "COGNOME"; $valore = $_REQUEST['cognome']; } else if ($selected == 'nome') { $ricerca = "NOME"; $valore = $_REQUEST['nome']; } $tabella = getUsername(); $sql_str = "SELECT * FROM " . $tabella . " WHERE " . $ricerca . " LIKE '" . $valore ."%'"; $query = mysql_query($sql_str, $conn) or die ("Errore nella query"); if ($riga = mysql_fetch_array($query)){ $query = mysql_query($sql_str, $conn) or die ("Errore nella query"); echo "<table width = 100% border = 1 cellpadding = 2 cellspacing = 2>"; echo "<tr>"; echo "<td></td>"; echo "<td>Cognome</td>"; echo "<td>Nome</td>"; echo "<td>Data di nascita</td>"; echo "</tr>"; while ($riga = mysql_fetch_array($query)){ echo "<tr>"; echo "<td>"; echo "<a href='modifica.php?id=".$riga["IdIscritto"]."'>Modifica[/url] "; echo "<a href='elimina.php?id=".$riga["IdIscritto"]."'>Elimina[/url] "; echo "</td>"; echo "<td>" . $riga['Cognome'] . "</td>"; echo "<td>" . $riga['Nome'] . "</td>"; echo "<td>" . $riga['DataNascita'] . "</td>"; echo "</tr>"; } } mysql_close($conn); } ?>
Copyleft: Tutto il materiale pubblicato o comunque presente all'interno del sito www.joomla.it può essere utilizzato, diffuso e modificato liberamente. Hosting fornito gratuitamente da Joomlahost.it Disegno web da kreatif multimedia srl