Delete matching ID and insert new data Delete all matching ID
Insert new data

function add_date($id,$date) {

mysql_query("DELETE FROM wp_opening_date WHERE Id='$id'");
$dates = explode(",",$date);
foreach ($dates as $date) { 
    $date = explode("/",$date);
    $d    = $date[0];
    $m    = $date[1];
    $y    = $date[2];   
    mysql_query("INSERT INTO wp_opening_date (Id, D, M, Y) VALUES ('$id','$d', '$m', '$y')");   
}
mysql_close();


}


And i using function like this

$id = '277';
$dates = '01/10/2012,28/11/2012,27/11/2012,29/11/2012';
add_date($id,$dates);


Review my code + idea pls

The idea i will searching Ids by month or year or date
Well, there's nothing wrong as far as I can see here. The only thing I would check is that there is a suitable index on the Id field in database, so the delete query can be performed relatively quick.

Another thing to consider is the size of your table. If you have lots of records in there, it can take considerable time to remove and re-add records again (due to indexing and re-indexing upon each delete/insert). In such case, I would simply add a flag to the database, marking those old dates as deleted and simply add new ones at the end of the table.

Yet another thing that comes to my mind now is that you can gain even more performance-wise if you grouped those single inserts like so:

$vals = array();
foreach ($dates as $date) { 
    $date = explode("/",$date);
    $d    = $date[0];
    $m    = $date[1];
    $y    = $date[2];
    $vals[] = "('$id', '$d', '$m', '$y')";
}
mysql_query("INSERT INTO wp_opening_date (Id, D, M, Y) VALUES ".implode(',', $vals));


At last, please do not use mysql_* functions, they are now deprecated. See the PHP manual for mysql_query for more info.