<html>
<link rel="stylesheet" type="text/css" href="stile.css">
<head>
<?php
// Comessione database
mysql_connect("localhost", "root", "marcoprove") or die ("Connessione non riuscita: " . mysql_error());
mysql_select_db("utenti") or die ("Connessione non riuscita: " . mysql_error());
// estrazione dati
$sql="SELECT * FROM anagrafica";
if(isset($_GET["nome"])){
$sql.=" WHERE nome='".$_GET['nome']."'";
}
$result = mysql_query($sql);
echo"<table>";
echo "<tr> <th>id</th> <th>Nome</th> <th>Cognome</th> <th>Email</th> </tr>";
while($row = mysql_fetch_array( $result )) {
// stampa tabella
echo "<tr>";
echo "<td>".$row['id']."<td>";
echo "<td>".$row['Nome']."<td>";
echo "<td>".$row['Cognome']."<td>";
echo "<td>".$row['Email']."<td>";
echo "</tr>";
}
echo"</table>";
?>
</body>
</html>

Rispondi quotando