I want to display message box. I don't know why it is not working.
Instead of "Already Registered..!!" message it displays " Duplicate entry 'test' for key 'nom' " .
Thanking you in advanced.
$query = " SELECT * FROM Humeur_log WHERE prenom = '".$prenom."' AND nom = '".$nom."' AND CURRENT_TIMESTAMP >= DATE_ADD( datelog, INTERVAL 24 HOUR ) LIMIT 0 , 30";
$result = mysql_query($query);
$NumResponse = mysql_num_rows($result);
if ($NumResponse>0)
{
echo "<script type='text/javascript'>\n";
echo "alert('You are already registered..!! ')\n";
echo "</script>";
}
else
{
$query = " INSERT INTO `ogysformtryit`.`Humeur_log` (`logid` ,`prenom` ,`nom` ,`datelog` ,`humeurlog`)VALUES (NULL , '".$prenom."', '".$nom."', CURRENT_TIMESTAMP , '".$humeur."') " ;
$result = mysql_query($query) or die(mysql_error());;
echo "<script type='text/javascript'>\n";
echo "alert('Successfully registered..!! .!')\n";
echo "</script>";
echo "<br />";