插入忽略 - 有没有办法知道语句是否被忽略? MYSQL

$sql_insert = "INSERT IGNORE .....";


if(mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error()))
{
      //code to execute
}

I want to execute code if the row is inserted. Is there some time of value that can be returned that would tell me if the statement was inserted or ignored?

Edit: Right now, "code to execute" always executes - even on ignore instances

mysql_affected_rows() will return 1 or 0, 1 if the insert took place

if(mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error()))
{
      if(mysql_affected_rows($link)==1){
       //insert took place
       }else{
       //no insert
       }


}