Ecco fatto!Codice PHP:
<?
$myconn = mysql_connect('localhost', 'user', 'xxxxxx') or die("Errore...");
mysql_select_db('nome_database', $myconn) or die("Errore...");
$username = "username da controllare";
$query = "SELECT * FROM tabella WHERE username = '$username'";
$result = mysql_query($query, $myconn) or die("Errore...");
$numero = mysql_num_rows($result);
if ($numero == 0)
{
//L'username non c'è nella tabella
}
else
{
//L'username c'è nella tabella!
}
?>![]()