I have a php with mysql that would insert some data to the database if there isn't the same information
<?php 
$id=$_POST['id'];
$guildname=$_POST['guildname'];
$level=$_POST['level'];
$score=$_POST['score'];
$guildmaster=$_POST['guildmaster'];
$con = mysql_connect("localhost", "root", "");
if (!$con)
  {die('Could not connect to mysql: ' . mysql_error());} 
$mydb = mysql_select_db("gunbound");
if (!$mydb)
  {die('Could not connect to database: ' . mysql_error());} 
  $dup = mysql_query("SELECT Id FROM guildrequest WHERE Id='".$_POST['id']."'");
        if(mysql_num_rows($dup) >= 1){
            echo '<b>You have already ask for guild request.</b>';
        }
        else
        {
     $dup2 = mysql_query("INSERT INTO guildrequest VALUES ('$id', '$guildname', '$level', '$score', '$guildmaster')");
        }
 Print "<center>You have requested to join the guild.</center>"; 
mysql_close($con);
?> 
but its not adding the record to the database if there isn't a record equal
Nor executing this:
$dup2 = mysql_query("INSERT INTO guildrequest VALUES ('$id', '$guildname', '$level', '$score', '$guildmaster')");
even if the code:
if(mysql_num_rows($dup) >= 1){
says that he can do the action of inserting
please help me
 
     
    