I have 2 tables:
--------
trips:

id
week
location
theme

days:

id
tid
day
daycontent
----------------

Users specify in form1 how many days the trip lasts and they fill out the fields week,location,theme, and are then directed to form after submitting.

In form 2 the form generates the amount of fields for the days specified in form1.

For the insert statement regarding the table days i use:
-----------
$day_length = sizeof($daycontent);

if($day_length>0){

$insert_str = "";
$tid=$id;

for($i=1; $i <= $day_length; $i++){
if($i > 1)
$insert_str .= ",";
$insert_str .= "( $tid , $i , '$daycontent[$i]' )";
}

mysql_query("INSERT INTO days (tid,day,daycontent) VALUES " .
$insert_str) or die("insert failed");

-----------

The form and inserting days works fine, but a user should be able to change the amount of days for a trip on form2
So if a trip currently is currently 4 days and a user wants to add 3 days to make it 7 then I would need to have the first 4 days updated and the last 3 days inserted, since days 1 to 4 are already in the database.

How can I accomplish this?