Mon SELECT COUNT me renvoie toujours 1
Bonjour,
Petit problème...quoiqu'il arrive mon Select Count me renvois 1...même quand ma table est vide...
Code:
1 2 3 4 5 6 7 8 9 10 11
|
$nombre=mysql_query("SELECT COUNT(email) FROM profiles WHERE email='$email'") or die ("<h1>erreur insert ".mysql_error()."</h1>");
$nombre=mysql_num_rows($nombre);
print $nombre;
if($nombre<0) //---Si il n'existe pas, alors on ajoute---//
{
mysql_query("INSERT INTO profiles (email) VALUES ('$email') ") or die ("<h1>erreur insert ".mysql_error()."</h1>");
print ("<h1>insertion réalisée !</h1><br>"); //---OK ajout effectué---//
}
else print ("<h1>Email déjà existant !</h1><br>"); //---Email déjà existant---// |
Si quelqu'un peut m'aider...